<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Thank for the follow-up
    <p><style type="text/css">p, li { white-space: pre-wrap; }</style><style type="text/css">p, li { white-space: pre-wrap; }</style></p>
    <p>Le 2022-07-26 à 15 h 55, Thomas Baumgart a écrit :</p>
    <blockquote type="cite" cite="mid:3683744.kQq0lBPeGt@sy-346-nb">
      <pre class="moz-quote-pre" wrap="">Jonatan,

On Dienstag, 26. Juli 2022 04:57:31 CEST Jonatan Cloutier via KMyMoney-devel wrote:

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">Hello, I'm looking at a way of automatically pulling data in my KMyMoney 
files. I already have the source data, but I'm now trying to find a way 
to get it automatically into the KMyMoney file. The main requirement is 
that I would highly prefer not to take manual action from KMyMoney.
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Which source format does your data have?</pre>
    </blockquote>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The original src is a bit of anything, mainly web scraping, but might be REST API calls as well if I get this working, then I can produce whatever format fit my need. As a quick workaround I'm doing csv, but that still needs a lot of manual processing to avoid duplicate transaction.</p>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All in all the reason for this is that my bank is getting worse every year at producing meaningful ofx files that just need way too many manual fix after import (more info available in that feature request: <a class="moz-txt-link-freetext" href="https://bugs.kde.org/show_bug.cgi?id=452392">https://bugs.kde.org/show_bug.cgi?id=452392</a> ) and furthermore, there is no export feature for loans and investments which are quite cumbersome to manually update, in particular the later. And to put a cherry on top, exports are limited to 30 days, which I frequently miss the dead line!</p>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">woob doesn't really work as my bank isn't supported and having double factor authentication, I'm not sure it can work out. </p>
    <style type="text/css">p, li { white-space: pre-wrap; }</style>
    <blockquote type="cite" cite="mid:3683744.kQq0lBPeGt@sy-346-nb">
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">After all that being said, two main questions: 1. Is it possible to run 
a background listener/task in a plugin as described above? 2. Any other 
suggestion on how to script custom data modification automatically?
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
I don't know how much knowledge of programming in C++/Qt you bring along.
The background listener is probably not so easy to implement. A way to solve
your problem might be to construct a KMyMoney statement file in an external
tool. It's XML formatted and used internally by KMyMoney by all the importers.
AFAIR, there is a mechanism to start KMyMoney with an importer file as argument
and it will import it into the last opened KMyMoney file. If KMyMoney is already
running it will use the so called WebConnect feature to import it into the
already running process. In any case, you would need to have KMyMoney running
and this is only supported with a graphical user interface.

So, maybe you can elaborate a bit about your (programming) skills and the operating
system you are using.</pre>
    </blockquote>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">I'm on archlinux, been developing for years mainly in java and pythons but do have a bit of experience in c++ and did use QT for some very old project.</p>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">I've seen the webconnect features from the main, since it's not limited to just the ofx importer I've been thinking that a custom importer could do the job, but haven't really thought of using the statement format as it doesn't seem documented. But if that enable doing the transaction import without modal, I suppose it could work. Closest to documentation I found is MyMoneyStatement::read function and its surroundings. I also see that there is a write method, is it possible to export in that format? It would just be quicker to get all the right xml structure. </p>
    <style type="text/css">p, li { white-space: pre-wrap; }</style>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">I will investigate more on that possibility, might be easier than creating a new importer and in the end, I think it could be close to my hopes in terms of usability.</p>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</p>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Quickly looking at that read method, I do have two questions:</p>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">* Are the m_accountId in the statement and in the split required to be internal KMyMoney id or they can be inferred like from ofx? I suppose they are the internal Id</p>
    <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">* Similarly, are both part of the split needed to be filled or is there a way in the import that the automatching of paye and categories and scheduled transaction would work like an ofx import? </p>
    <style type="text/css">p, li { white-space: pre-wrap; }</style>
    <p>
</p>
    <p>Thanks again.
</p>
  </body>
</html>