Automated task plugin

Thomas Baumgart thb at net-bembel.de
Tue Jul 26 20:55:15 BST 2022


Jonatan,

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

> 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.

Which source format does your data have?

> My first solution was to move to the database back end and make sure to 
> understand how to create transaction properly. But then I realize that 
> the database backend is really not working properly for my need (the 
> file like access kind of defeat the purpose and it is way too slow to 
> open and close to be usable) digging a bit in the mailling list, it 
> doesn't appear to be a recomanded way of using the software anymore.

At least not at the moment.

> Next I'm thinking of either creating an import like plugin that would be 
> able to automatically feed itself from a socket receiving data and 
> creating the required transaction, or if the socket isn't really an 
> option, automatically reading a specific file. But in both cases I fear 
> that the plugin framework wouldn't allow me to have that background task 
> running and updating my transactions without user action.
> 
> If a user action is really needed, I might go with the specific file 
> solution and it would not have any wizard or file selection modal, a bit 
> like the update your accounts without the passwords.
> 
> Another thing I would have liked, would be to do that import even if the 
> software isn't running (defeating all above solution except the 
> database) and for that I was thinking of using KMyMoney as a lib to load 
> the kmy file, use the MyMoneyFile API to make any change and save it 
> back. But I'll get an issue if the file is open in the real software and 
> all change will be overridden and since KMyMoney isn't developed as a 
> library I expect that those "API" could be broken at any time and 
> obviously that's going to happen when I don't have the time to fix my tools!

KMyMoney was never designed to support the access from two processes at the
same time.

> 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?

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.

-- 

Regards

Thomas Baumgart

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
LINUX is like a wigwam.. no windows, no gates and apache inside.
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20220726/dd30c948/attachment.sig>


More information about the KMyMoney-devel mailing list