Re: [GNC] Adding Transactions From Another Program
On 5/8/2020 12:29 PM, John Ralls wrote: GNU BASH, a.k.a. the Bourne Again Shell (because it was originally a Free clean room clone of SysV's Bourne Shell) is the default shell (terminal command processor) on many Linux systems. . It has nothing at all to do with GnuCash and discussing it further in this list wouldn't be appropriate. The ONLY relevance would be because the original topic involved reformatting data so it could be imported into gnucash. Since the bash shell + library of standard 'nix utilities constitute a complete language (of fundamental data type "string") it could well be used for the purpose. In other words, instead of python, etc. If I were tackling the problem under a 'nix, I might do it that way. Michael D Novack ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.
Re: [GNC] Adding Transactions From Another Program
GNU BASH, a.k.a. the Bourne Again Shell (because it was originally a Free clean room clone of SysV's Bourne Shell) is the default shell (terminal command processor) on many Linux systems. The manual is at https://www.gnu.org/software/bash/manual/bash.html and you'll find abundant documentation and discussion about it on the web. It has nothing at all to do with GnuCash and discussing it further in this list wouldn't be appropriate. GnuCash Help is half of GnuCash's documentation and is available from Help>Contents in the GnuCash GUI and from https://www.gnucash.org/docs.phtml. It's focused on the details of using the GUI and won't be of much help in writing scripts that operate on GnuCash data. The developer documentation at https://code.gnucash.org/docs/MASTER will be more useful, they document parts of GnuCash's C API, not all of which is exposed to Python. If you want a summary of GnuCash's command line options use `gnucash --help`. The only command-line batch operation GnuCash has built in is price import. The importers are not accessible from the language bindings, though the QIF importer is written in Guile so a proficient Schemer could import its modules directly. Regards, John Ralls > On May 7, 2020, at 10:44 PM, Hal Vaughan wrote: > > > >> Begin forwarded message: >> >> From: Hal Vaughan >> Subject: Re: [GNC] Adding Transactions From Another Program >> Date: May 8, 2020 at 1:42:28 AM EDT >> To: david whiting >> >> I think that’s it! >> >> First, a comment: I went on and installed Homebrew and things seemed to work >> - until I tried running pip. Nope. It looks for $PYENV_COMMAND_PATH and >> that’s null. (Even after rebooting and using a new terminal.) And people >> wonder why I hate those add-ons like that. >> >> Okay, on topic - yes, this could work. I got curious - is there a way I can >> do more to automate this? For instance, run my Python script, have it parse >> the GC file, then create the QIF file, save it. Then I thought, "It would >> be nice if it could get GC to import the new QIF file, then exit GC and >> delete the QIF file all one one shot. I did some searching and found >> something that said to try "Gnucash help." No "—" before the "help," but I >> tried it. GC came up, but I tried typing "help" in the console again. When >> I quit GC, I got this: >> >> These shell commands are defined internally. Type `help' to see this list. >> Type `help name' to find out more about the function `name'. >> Use `info bash' to find out more about the shell in general. >> Use `man -k' or `info' to find out more about commands not in this list. >> >> A star (*) next to a name means that the command is disabled. >> >> JOB_SPEC [&] (( expression )) >> . filename [arguments] : >> [ arg... ] [[ expression ]] >> alias [-p] [name[=value] ... ] bg [job_spec ...] >> bind [-lpvsPVS] [-m keymap] [-f fi break [n] >> builtin [shell-builtin [arg ...]] caller [EXPR] >> case WORD in [PATTERN [| PATTERN]. cd [-L|-P] [dir] >> command [-pVv] command [arg ...] compgen [-abcdefgjksuv] [-o option >> complete [-abcdefgjksuv] [-pr] [-o continue [n] >> declare [-afFirtx] [-p] [name[=val dirs [-clpv] [+N] [-N] >> disown [-h] [-ar] [jobspec ...]echo [-neE] [arg ...] >> enable [-pnds] [-a] [-f filename] eval [arg ...] >> exec [-cl] [-a name] file [redirec exit [n] >> export [-nf] [name[=value] ...] or false >> fc [-e ename] [-nlr] [first] [last fg [job_spec] >> for NAME [in WORDS ... ;] do COMMA for (( exp1; exp2; exp3 )); do COM >> function NAME { COMMANDS ; } or NA getopts optstring name [arg] >> hash [-lr] [-p pathname] [-dt] [na help [-s] [pattern ...] >> history [-c] [-d offset] [n] or hi if COMMANDS; then COMMANDS; [ elif >> jobs [-lnprs] [jobspec ...] or job kill [-s sigspec | -n signum | -si >> let arg [arg ...] local name[=value] ... >> logout popd [+N | -N] [-n] >> printf [-v var] format [arguments] pushd [dir | +N | -N] [-n] >> pwd [-LP] read [-ers] [-u fd] [-t timeout] [ >> readonly [-af] [name[=value] ...] return [n] >> select NAME [in WORDS ... ;] do CO set [--abefhkmnptuvxBCHP] [-o opti >> shift [n] shopt [-pqsu] [-o long-option] opt >> source filename [arguments]suspend [-f] >> test [expr]time [-p] PIPELINE >> times trap [-lp] [arg signal_spe
Re: [GNC] Adding Transactions From Another Program
Hi Hal, Looking back at your original question, perhaps there's an alternative approach that will achieve what you want to do. Rater than using python to add the entries directly, once your python script has found the transactions, use that to write a qif file that specifies the transactions you want and then import that file in gnucash. I do something similar where I have to create monthly subs transactions covering six months for about 450 club members, so about 2,700 transactions. The amount of the subs each member pays depends on the team the member is in so the script that works out which team each member is in, looks up the monthly amount in a separate look-up csv file and then creates the qif file. I then import this into gnucash at the beginning of the season (s the transactions have dates in the future). The qif format is simple to create. This has worked nicely for me. David On Thu, 7 May 2020 at 19:23, Hal Vaughan wrote: > > It took me time to do some research on this. (Even with staying at home now, > I have a ton going on and had to spend several full days just fixing my > tractor.) > > Homebrew looked like it wasn’t much of a problem and I installed it. > Everything still works. (That’s another part of research - I still have to > go through the folder where all my scripts are and figure out which ones I > still need that may be using oddball or outdated Perl or Python modules. I > have notes on a number of them that I use whenever I upgrade to a new > computer, so that’ll help, but it’s still a time waster!) > > So, ignoring the entertaining auto-correct issue here, if I use Homebrew, it > just installs from a stock .dmg image. So if I want Python bindings, > Homebrew is irrelevant? As in it doesn’t matter if I use it or not, I can > just get the source code for GC and compile it on my system to get the > bindings. Is that right? > > That leads to a number of questions: > 1. I’m not inexperienced as a programmer, but it’s almost all with Perl, > Python, and Java. Years ago I did some C++, but have done very little in > learning how to control compilers. How hard is compiling GC from scratch? > 2. If I compile from scratch, do I have to add anything extra to get Python > bindings, or do I just have to select the option for that when I compile? > 3. What about upgrades? Will I have to recompile GC every time I want to > upgrade it on my system? (That is, assuming I want to keep the bindings?) > > From what people are saying, trying to add entries is not good, but that I > can import from a CSV or TSV file. > > While that was on another branch of this thread, that does bring up a few > questions: > > 1. Is there any protection to keep GC from importing the same transaction > multiple times? For instance, if I have a transaction for interest in a CSV > file, then add another in the file and re-import, will GC note one > transaction it’s importing is identical to another and flag it for me? > 2. Is there any way, from within GC, to run an external script that would > create the interest entries? Then, once they’re created, I could import that > CSV file? Or would I have to run the interest calculating script from > outside GC? > > > Hal > > > On Apr 30, 2020, at 11:51 PM, D. wrote: > > > > Hal, > > > > John Ralls, the person who manages the Mac end of GnuCash, has pointed out > > that Homebrew simply uses the GnuCash dmg for its installation. That dmg > > does not include python bindings, so the answer to your question is "No, > > Homebrew does not include python. You would need to clozapine GnuCash > > yourself." > > > > David T. > > > > > > Original Message > > From: Hal Vaughan > > Sent: Fri May 01 01:32:14 GMT+05:30 2020 > > To: Gnucash > > Subject: Re: [GNC] Adding Transactions From Another Program > > > > Actually, this has me looking over what I am and am not still using. > > > > Since Mac is still using Python 2.7, but Catalina is coming up and that > > includes Python 3.x. So I’m looking over what I use and what I don’t among > > my decades of scripts. > > > > Last I looked, pretty much every system like that usurped the originals. > > At the time, when I looked them over, it became clear to me why they did > > that and it made sense. But, again, that decision was something like 10 > > years ago and I haven’t had time or cause to revisit it - until now. > > > > Do you know if Homebrew can provide the Python bindings for GC? > > > > > > Hal > > > >> On Apr 30, 2020, at 2:27 AM, Adrien Monteleone > >> wrote: > >> > >> Have
Re: [GNC] Adding Transactions From Another Program
Homebrew isn't necessarily irrelevant, but if you decide to build with jhbuild and gtk-osx (https://wiki.gnucash.org/wiki/MacOSX/Quartz) it gets in the way. There's another, older, turn-your-mac-into-linux system called MacPorts that provides GnuCash. You'll wind up building yourself but you may find that it's less painful than gtk-osx, particularly if you want to keep Homebrew. There are instructions for this build at https://wiki.gnucash.org/wiki/MacOSX/MacPortsDetail. GnuCash developer emeritus Mike Alexander uses this method. You might also be able to install all of the dependencies with Homebrew and then build GnuCash on top of that. I've never tried and there's no existing recipe so you'd have to figure out what are the Homebrew names for everything and get it all installed. Once you have the dependencies in place building isn't hard and doesn't require any C/C++ or Scheme programming skill, just some familiarity with build systems like Cmake. Yes, you will have to build a new GnuCash every time you want to upgrade, but once you have everything set up and working it's just running a single build script and waiting an hour or four. Regards, John Ralls > On May 7, 2020, at 11:22 AM, Hal Vaughan wrote: > > It took me time to do some research on this. (Even with staying at home now, > I have a ton going on and had to spend several full days just fixing my > tractor.) > > Homebrew looked like it wasn’t much of a problem and I installed it. > Everything still works. (That’s another part of research - I still have to > go through the folder where all my scripts are and figure out which ones I > still need that may be using oddball or outdated Perl or Python modules. I > have notes on a number of them that I use whenever I upgrade to a new > computer, so that’ll help, but it’s still a time waster!) > > So, ignoring the entertaining auto-correct issue here, if I use Homebrew, it > just installs from a stock .dmg image. So if I want Python bindings, > Homebrew is irrelevant? As in it doesn’t matter if I use it or not, I can > just get the source code for GC and compile it on my system to get the > bindings. Is that right? > > That leads to a number of questions: > 1. I’m not inexperienced as a programmer, but it’s almost all with Perl, > Python, and Java. Years ago I did some C++, but have done very little in > learning how to control compilers. How hard is compiling GC from scratch? > 2. If I compile from scratch, do I have to add anything extra to get Python > bindings, or do I just have to select the option for that when I compile? > 3. What about upgrades? Will I have to recompile GC every time I want to > upgrade it on my system? (That is, assuming I want to keep the bindings?) > > From what people are saying, trying to add entries is not good, but that I > can import from a CSV or TSV file. > > While that was on another branch of this thread, that does bring up a few > questions: > > 1. Is there any protection to keep GC from importing the same transaction > multiple times? For instance, if I have a transaction for interest in a CSV > file, then add another in the file and re-import, will GC note one > transaction it’s importing is identical to another and flag it for me? > 2. Is there any way, from within GC, to run an external script that would > create the interest entries? Then, once they’re created, I could import that > CSV file? Or would I have to run the interest calculating script from > outside GC? > > > Hal > >> On Apr 30, 2020, at 11:51 PM, D. wrote: >> >> Hal, >> >> John Ralls, the person who manages the Mac end of GnuCash, has pointed out >> that Homebrew simply uses the GnuCash dmg for its installation. That dmg >> does not include python bindings, so the answer to your question is "No, >> Homebrew does not include python. You would need to clozapine GnuCash >> yourself." >> >> David T. >> >> >> Original Message >> From: Hal Vaughan >> Sent: Fri May 01 01:32:14 GMT+05:30 2020 >> To: Gnucash >> Subject: Re: [GNC] Adding Transactions From Another Program >> >> Actually, this has me looking over what I am and am not still using. >> >> Since Mac is still using Python 2.7, but Catalina is coming up and that >> includes Python 3.x. So I’m looking over what I use and what I don’t among >> my decades of scripts. >> >> Last I looked, pretty much every system like that usurped the originals. At >> the time, when I looked them over, it became clear to me why they did that >> and it made sense. But, again, that decision was some
Re: [GNC] Adding Transactions From Another Program
It took me time to do some research on this. (Even with staying at home now, I have a ton going on and had to spend several full days just fixing my tractor.) Homebrew looked like it wasn’t much of a problem and I installed it. Everything still works. (That’s another part of research - I still have to go through the folder where all my scripts are and figure out which ones I still need that may be using oddball or outdated Perl or Python modules. I have notes on a number of them that I use whenever I upgrade to a new computer, so that’ll help, but it’s still a time waster!) So, ignoring the entertaining auto-correct issue here, if I use Homebrew, it just installs from a stock .dmg image. So if I want Python bindings, Homebrew is irrelevant? As in it doesn’t matter if I use it or not, I can just get the source code for GC and compile it on my system to get the bindings. Is that right? That leads to a number of questions: 1. I’m not inexperienced as a programmer, but it’s almost all with Perl, Python, and Java. Years ago I did some C++, but have done very little in learning how to control compilers. How hard is compiling GC from scratch? 2. If I compile from scratch, do I have to add anything extra to get Python bindings, or do I just have to select the option for that when I compile? 3. What about upgrades? Will I have to recompile GC every time I want to upgrade it on my system? (That is, assuming I want to keep the bindings?) From what people are saying, trying to add entries is not good, but that I can import from a CSV or TSV file. While that was on another branch of this thread, that does bring up a few questions: 1. Is there any protection to keep GC from importing the same transaction multiple times? For instance, if I have a transaction for interest in a CSV file, then add another in the file and re-import, will GC note one transaction it’s importing is identical to another and flag it for me? 2. Is there any way, from within GC, to run an external script that would create the interest entries? Then, once they’re created, I could import that CSV file? Or would I have to run the interest calculating script from outside GC? Hal > On Apr 30, 2020, at 11:51 PM, D. wrote: > > Hal, > > John Ralls, the person who manages the Mac end of GnuCash, has pointed out > that Homebrew simply uses the GnuCash dmg for its installation. That dmg does > not include python bindings, so the answer to your question is "No, Homebrew > does not include python. You would need to clozapine GnuCash yourself." > > David T. > > > Original Message > From: Hal Vaughan > Sent: Fri May 01 01:32:14 GMT+05:30 2020 > To: Gnucash > Subject: Re: [GNC] Adding Transactions From Another Program > > Actually, this has me looking over what I am and am not still using. > > Since Mac is still using Python 2.7, but Catalina is coming up and that > includes Python 3.x. So I’m looking over what I use and what I don’t among > my decades of scripts. > > Last I looked, pretty much every system like that usurped the originals. At > the time, when I looked them over, it became clear to me why they did that > and it made sense. But, again, that decision was something like 10 years ago > and I haven’t had time or cause to revisit it - until now. > > Do you know if Homebrew can provide the Python bindings for GC? > > > Hal > >> On Apr 30, 2020, at 2:27 AM, Adrien Monteleone >> wrote: >> >> Have you investigated Homebrew vs. MacPorts? >> >> Just curious if the Perl issues are the same. >> >> Regards, >> Adrien >> >>> On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan wrote: >>> >>> I’ve checked out the bindings - as I mentioned in my original post, the >>> problem is that using the bindings on a Mac requires MacPorts. I’ve had >>> issues before, since MacPorts (and other similar systems) usurp some of the >>> normal paths for things like Perl and Python. I don’t use Perl for coding >>> anymore, but I have Perl scripts I’ve been using for over a decade that do >>> some simple work for me. I had an important Perl script I was using that >>> used a specific Perl library. I don’t remember which one it was, but when >>> I added MacPorts and tried to run my script a week later, it crashed. >>> >>> I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the >>> normal system paths for scripting languages. When I installed it, and it >>> took over for Perl, it put in a system without all the libraries my scripts >>> used and some of the libraries that were available to me with a standard >>> Perl install (libraries I had ins
Re: [GNC] Adding Transactions From Another Program
I thought it was related to the due identity issues with python 2.7 and python 3.x On Fri, 1 May 2020 at 06:30, D. via gnucash-user wrote: > > That somehow seems to be an entirely justified substitution in my case! > > > Original Message > From: John Ralls > Sent: Fri May 01 10:34:54 GMT+05:30 2020 > To: "D." > Cc: Hal Vaughan , "D. via gnucash-user" > > Subject: Re: [GNC] Adding Transactions From Another Program > > Maybe one supplied by a drug manufacturer. Google tells me that Clozapine is > an antipsychotic. > > Regards, > John Ralls > > > > On Apr 30, 2020, at 9:54 PM, D. via gnucash-user > > wrote: > > > > "clozapine"="compile" > > > > Not sure what dictionary my machine is using! > > > > > > Original Message ---- > > From: "D. via gnucash-user" > > Sent: Fri May 01 09:21:46 GMT+05:30 2020 > > To: Hal Vaughan > > Cc: "D. via gnucash-user" > > Subject: Re: [GNC] Adding Transactions From Another Program > > > > Hal, > > > > John Ralls, the person who manages the Mac end of GnuCash, has pointed out > > that Homebrew simply uses the GnuCash dmg for its installation. That dmg > > does not include python bindings, so the answer to your question is "No, > > Homebrew does not include python. You would need to clozapine GnuCash > > yourself." > > > > David T. > > > > > > Original Message > > From: Hal Vaughan > > Sent: Fri May 01 01:32:14 GMT+05:30 2020 > > To: Gnucash > > Subject: Re: [GNC] Adding Transactions From Another Program > > > > Actually, this has me looking over what I am and am not still using. > > > > Since Mac is still using Python 2.7, but Catalina is coming up and that > > includes Python 3.x. So I’m looking over what I use and what I don’t among > > my decades of scripts. > > > > Last I looked, pretty much every system like that usurped the originals. > > At the time, when I looked them over, it became clear to me why they did > > that and it made sense. But, again, that decision was something like 10 > > years ago and I haven’t had time or cause to revisit it - until now. > > > > Do you know if Homebrew can provide the Python bindings for GC? > > > > > > Hal > > > >> On Apr 30, 2020, at 2:27 AM, Adrien Monteleone > >> wrote: > >> > >> Have you investigated Homebrew vs. MacPorts? > >> > >> Just curious if the Perl issues are the same. > >> > >> Regards, > >> Adrien > >> > >>> On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan wrote: > >>> > >>> I’ve checked out the bindings - as I mentioned in my original post, the > >>> problem is that using the bindings on a Mac requires MacPorts. I’ve had > >>> issues before, since MacPorts (and other similar systems) usurp some of > >>> the normal paths for things like Perl and Python. I don’t use Perl for > >>> coding anymore, but I have Perl scripts I’ve been using for over a decade > >>> that do some simple work for me. I had an important Perl script I was > >>> using that used a specific Perl library. I don’t remember which one it > >>> was, but when I added MacPorts and tried to run my script a week later, > >>> it crashed. > >>> > >>> I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the > >>> normal system paths for scripting languages. When I installed it, and it > >>> took over for Perl, it put in a system without all the libraries my > >>> scripts used and some of the libraries that were available to me with a > >>> standard Perl install (libraries I had installed from CPAN) would not > >>> install in the new system. I had to completely remove MacPorts to get my > >>> old scripts to work. > >>> > >>> I’d love to use MacPorts, since it makes a lot available to me that I > >>> can’t easily add now (unless I start using a Linux VM), but that > >>> experience taught me never to trust such a system. > >>> > >>> I think it would be a lot easier for me to do this with Python bindings, > >>> but I still use older scripts for things I need to do once a month or > >>> once a year and I don’t want to risk breaking them again like they broke > >>> about a decade ago when I installed MacPorts. > >>> &
Re: [GNC] Adding Transactions From Another Program
That somehow seems to be an entirely justified substitution in my case! Original Message From: John Ralls Sent: Fri May 01 10:34:54 GMT+05:30 2020 To: "D." Cc: Hal Vaughan , "D. via gnucash-user" Subject: Re: [GNC] Adding Transactions From Another Program Maybe one supplied by a drug manufacturer. Google tells me that Clozapine is an antipsychotic. Regards, John Ralls > On Apr 30, 2020, at 9:54 PM, D. via gnucash-user > wrote: > > "clozapine"="compile" > > Not sure what dictionary my machine is using! > > > Original Message > From: "D. via gnucash-user" > Sent: Fri May 01 09:21:46 GMT+05:30 2020 > To: Hal Vaughan > Cc: "D. via gnucash-user" > Subject: Re: [GNC] Adding Transactions From Another Program > > Hal, > > John Ralls, the person who manages the Mac end of GnuCash, has pointed out > that Homebrew simply uses the GnuCash dmg for its installation. That dmg does > not include python bindings, so the answer to your question is "No, Homebrew > does not include python. You would need to clozapine GnuCash yourself." > > David T. > > > ---- Original Message ---- > From: Hal Vaughan > Sent: Fri May 01 01:32:14 GMT+05:30 2020 > To: Gnucash > Subject: Re: [GNC] Adding Transactions From Another Program > > Actually, this has me looking over what I am and am not still using. > > Since Mac is still using Python 2.7, but Catalina is coming up and that > includes Python 3.x. So I’m looking over what I use and what I don’t among > my decades of scripts. > > Last I looked, pretty much every system like that usurped the originals. At > the time, when I looked them over, it became clear to me why they did that > and it made sense. But, again, that decision was something like 10 years ago > and I haven’t had time or cause to revisit it - until now. > > Do you know if Homebrew can provide the Python bindings for GC? > > > Hal > >> On Apr 30, 2020, at 2:27 AM, Adrien Monteleone >> wrote: >> >> Have you investigated Homebrew vs. MacPorts? >> >> Just curious if the Perl issues are the same. >> >> Regards, >> Adrien >> >>> On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan wrote: >>> >>> I’ve checked out the bindings - as I mentioned in my original post, the >>> problem is that using the bindings on a Mac requires MacPorts. I’ve had >>> issues before, since MacPorts (and other similar systems) usurp some of the >>> normal paths for things like Perl and Python. I don’t use Perl for coding >>> anymore, but I have Perl scripts I’ve been using for over a decade that do >>> some simple work for me. I had an important Perl script I was using that >>> used a specific Perl library. I don’t remember which one it was, but when >>> I added MacPorts and tried to run my script a week later, it crashed. >>> >>> I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the >>> normal system paths for scripting languages. When I installed it, and it >>> took over for Perl, it put in a system without all the libraries my scripts >>> used and some of the libraries that were available to me with a standard >>> Perl install (libraries I had installed from CPAN) would not install in the >>> new system. I had to completely remove MacPorts to get my old scripts to >>> work. >>> >>> I’d love to use MacPorts, since it makes a lot available to me that I can’t >>> easily add now (unless I start using a Linux VM), but that experience >>> taught me never to trust such a system. >>> >>> I think it would be a lot easier for me to do this with Python bindings, >>> but I still use older scripts for things I need to do once a month or once >>> a year and I don’t want to risk breaking them again like they broke about a >>> decade ago when I installed MacPorts. >>> >>> >>> Hal >> >> >> ___ >> gnucash-user mailing list >> gnucash-user@gnucash.org >> To update your subscription preferences or to unsubscribe: >> https://lists.gnucash.org/mailman/listinfo/gnucash-user >> If you are using Nabble or Gmane, please see >> https://wiki.gnucash.org/wiki/Mailing_Lists for more information. >> - >> Please remember to CC this list on all your replies. >> You can do this by using Reply-To-List or Reply-All. >> > > ___ > gnuc
Re: [GNC] Adding Transactions From Another Program
Just in case GnuCash gets hysterical?? David On Thu, 2020-04-30 at 22:04 -0700, John Ralls wrote: > Maybe one supplied by a drug manufacturer. Google tells me that Clozapine is > an antipsychotic. > > Regards, > John Ralls > > > > On Apr 30, 2020, at 9:54 PM, D. via gnucash-user > > wrote: > > > > "clozapine"="compile" > > > > Not sure what dictionary my machine is using! > > > > > > Original Message > > From: "D. via gnucash-user" > > Sent: Fri May 01 09:21:46 GMT+05:30 2020 > > To: Hal Vaughan > > Cc: "D. via gnucash-user" > > Subject: Re: [GNC] Adding Transactions From Another Program > > > > Hal, > > > > John Ralls, the person who manages the Mac end of GnuCash, has pointed out > > that Homebrew simply uses the GnuCash dmg > > for its installation. That dmg does not include python bindings, so the > > answer to your question is "No, Homebrew > > does not include python. You would need to clozapine GnuCash yourself." > > > > David T. > > > > > > Original Message > > From: Hal Vaughan > > Sent: Fri May 01 01:32:14 GMT+05:30 2020 > > To: Gnucash > > Subject: Re: [GNC] Adding Transactions From Another Program > > > > Actually, this has me looking over what I am and am not still using. > > > > Since Mac is still using Python 2.7, but Catalina is coming up and that > > includes Python 3.x. So I’m looking over > > what I use and what I don’t among my decades of scripts. > > > > Last I looked, pretty much every system like that usurped the originals. > > At the time, when I looked them over, it > > became clear to me why they did that and it made sense. But, again, that > > decision was something like 10 years ago > > and I haven’t had time or cause to revisit it - until now. > > > > Do you know if Homebrew can provide the Python bindings for GC? > > > > > > Hal > > > > > On Apr 30, 2020, at 2:27 AM, Adrien Monteleone > > > wrote: > > > > > > Have you investigated Homebrew vs. MacPorts? > > > > > > Just curious if the Perl issues are the same. > > > > > > Regards, > > > Adrien > > > > > > > On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan wrote: > > > > > > > > I’ve checked out the bindings - as I mentioned in my original post, the > > > > problem is that using the bindings on a > > > > Mac requires MacPorts. I’ve had issues before, since MacPorts (and > > > > other similar systems) usurp some of the > > > > normal paths for things like Perl and Python. I don’t use Perl for > > > > coding anymore, but I have Perl scripts I’ve > > > > been using for over a decade that do some simple work for me. I had an > > > > important Perl script I was using that > > > > used a specific Perl library. I don’t remember which one it was, but > > > > when I added MacPorts and tried to run my > > > > script a week later, it crashed. > > > > > > > > I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the > > > > normal system paths for scripting > > > > languages. When I installed it, and it took over for Perl, it put in a > > > > system without all the libraries my > > > > scripts used and some of the libraries that were available to me with a > > > > standard Perl install (libraries I had > > > > installed from CPAN) would not install in the new system. I had to > > > > completely remove MacPorts to get my old > > > > scripts to work. > > > > > > > > I’d love to use MacPorts, since it makes a lot available to me that I > > > > can’t easily add now (unless I start using > > > > a Linux VM), but that experience taught me never to trust such a system. > > > > > > > > I think it would be a lot easier for me to do this with Python > > > > bindings, but I still use older scripts for > > > > things I need to do once a month or once a year and I don’t want to > > > > risk breaking them again like they broke > > > > about a decade ago when I installed MacPorts. > > > > > > > > > > > > Hal > > > > > > > > > ___ > > > gnu
Re: [GNC] Adding Transactions From Another Program
Maybe one supplied by a drug manufacturer. Google tells me that Clozapine is an antipsychotic. Regards, John Ralls > On Apr 30, 2020, at 9:54 PM, D. via gnucash-user > wrote: > > "clozapine"="compile" > > Not sure what dictionary my machine is using! > > > Original Message > From: "D. via gnucash-user" > Sent: Fri May 01 09:21:46 GMT+05:30 2020 > To: Hal Vaughan > Cc: "D. via gnucash-user" > Subject: Re: [GNC] Adding Transactions From Another Program > > Hal, > > John Ralls, the person who manages the Mac end of GnuCash, has pointed out > that Homebrew simply uses the GnuCash dmg for its installation. That dmg does > not include python bindings, so the answer to your question is "No, Homebrew > does not include python. You would need to clozapine GnuCash yourself." > > David T. > > > -------- Original Message ---- > From: Hal Vaughan > Sent: Fri May 01 01:32:14 GMT+05:30 2020 > To: Gnucash > Subject: Re: [GNC] Adding Transactions From Another Program > > Actually, this has me looking over what I am and am not still using. > > Since Mac is still using Python 2.7, but Catalina is coming up and that > includes Python 3.x. So I’m looking over what I use and what I don’t among > my decades of scripts. > > Last I looked, pretty much every system like that usurped the originals. At > the time, when I looked them over, it became clear to me why they did that > and it made sense. But, again, that decision was something like 10 years ago > and I haven’t had time or cause to revisit it - until now. > > Do you know if Homebrew can provide the Python bindings for GC? > > > Hal > >> On Apr 30, 2020, at 2:27 AM, Adrien Monteleone >> wrote: >> >> Have you investigated Homebrew vs. MacPorts? >> >> Just curious if the Perl issues are the same. >> >> Regards, >> Adrien >> >>> On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan wrote: >>> >>> I’ve checked out the bindings - as I mentioned in my original post, the >>> problem is that using the bindings on a Mac requires MacPorts. I’ve had >>> issues before, since MacPorts (and other similar systems) usurp some of the >>> normal paths for things like Perl and Python. I don’t use Perl for coding >>> anymore, but I have Perl scripts I’ve been using for over a decade that do >>> some simple work for me. I had an important Perl script I was using that >>> used a specific Perl library. I don’t remember which one it was, but when >>> I added MacPorts and tried to run my script a week later, it crashed. >>> >>> I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the >>> normal system paths for scripting languages. When I installed it, and it >>> took over for Perl, it put in a system without all the libraries my scripts >>> used and some of the libraries that were available to me with a standard >>> Perl install (libraries I had installed from CPAN) would not install in the >>> new system. I had to completely remove MacPorts to get my old scripts to >>> work. >>> >>> I’d love to use MacPorts, since it makes a lot available to me that I can’t >>> easily add now (unless I start using a Linux VM), but that experience >>> taught me never to trust such a system. >>> >>> I think it would be a lot easier for me to do this with Python bindings, >>> but I still use older scripts for things I need to do once a month or once >>> a year and I don’t want to risk breaking them again like they broke about a >>> decade ago when I installed MacPorts. >>> >>> >>> Hal >> >> >> ___ >> gnucash-user mailing list >> gnucash-user@gnucash.org >> To update your subscription preferences or to unsubscribe: >> https://lists.gnucash.org/mailman/listinfo/gnucash-user >> If you are using Nabble or Gmane, please see >> https://wiki.gnucash.org/wiki/Mailing_Lists for more information. >> - >> Please remember to CC this list on all your replies. >> You can do this by using Reply-To-List or Reply-All. >> > > ___ > gnucash-user mailing list > gnucash-user@gnucash.org > To update your subscription preferences or to unsubscribe: > https://lists.gnucash.org/mailman/listinfo/gnucash-user > If you are using Nabble or Gmane, please see > https://wiki.gnucash
Re: [GNC] Adding Transactions From Another Program
"clozapine"="compile" Not sure what dictionary my machine is using! Original Message From: "D. via gnucash-user" Sent: Fri May 01 09:21:46 GMT+05:30 2020 To: Hal Vaughan Cc: "D. via gnucash-user" Subject: Re: [GNC] Adding Transactions From Another Program Hal, John Ralls, the person who manages the Mac end of GnuCash, has pointed out that Homebrew simply uses the GnuCash dmg for its installation. That dmg does not include python bindings, so the answer to your question is "No, Homebrew does not include python. You would need to clozapine GnuCash yourself." David T. Original Message From: Hal Vaughan Sent: Fri May 01 01:32:14 GMT+05:30 2020 To: Gnucash Subject: Re: [GNC] Adding Transactions From Another Program Actually, this has me looking over what I am and am not still using. Since Mac is still using Python 2.7, but Catalina is coming up and that includes Python 3.x. So I’m looking over what I use and what I don’t among my decades of scripts. Last I looked, pretty much every system like that usurped the originals. At the time, when I looked them over, it became clear to me why they did that and it made sense. But, again, that decision was something like 10 years ago and I haven’t had time or cause to revisit it - until now. Do you know if Homebrew can provide the Python bindings for GC? Hal > On Apr 30, 2020, at 2:27 AM, Adrien Monteleone > wrote: > > Have you investigated Homebrew vs. MacPorts? > > Just curious if the Perl issues are the same. > > Regards, > Adrien > >> On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan wrote: >> >> I’ve checked out the bindings - as I mentioned in my original post, the >> problem is that using the bindings on a Mac requires MacPorts. I’ve had >> issues before, since MacPorts (and other similar systems) usurp some of the >> normal paths for things like Perl and Python. I don’t use Perl for coding >> anymore, but I have Perl scripts I’ve been using for over a decade that do >> some simple work for me. I had an important Perl script I was using that >> used a specific Perl library. I don’t remember which one it was, but when I >> added MacPorts and tried to run my script a week later, it crashed. >> >> I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the >> normal system paths for scripting languages. When I installed it, and it >> took over for Perl, it put in a system without all the libraries my scripts >> used and some of the libraries that were available to me with a standard >> Perl install (libraries I had installed from CPAN) would not install in the >> new system. I had to completely remove MacPorts to get my old scripts to >> work. >> >> I’d love to use MacPorts, since it makes a lot available to me that I can’t >> easily add now (unless I start using a Linux VM), but that experience taught >> me never to trust such a system. >> >> I think it would be a lot easier for me to do this with Python bindings, but >> I still use older scripts for things I need to do once a month or once a >> year and I don’t want to risk breaking them again like they broke about a >> decade ago when I installed MacPorts. >> >> >> Hal > > > ___ > gnucash-user mailing list > gnucash-user@gnucash.org > To update your subscription preferences or to unsubscribe: > https://lists.gnucash.org/mailman/listinfo/gnucash-user > If you are using Nabble or Gmane, please see > https://wiki.gnucash.org/wiki/Mailing_Lists for more information. > - > Please remember to CC this list on all your replies. > You can do this by using Reply-To-List or Reply-All. > ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All. ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All. ___ gnucash-user mailing list gnucash-user@gnucash.org To update your su
Re: [GNC] Adding Transactions From Another Program
Hal, John Ralls, the person who manages the Mac end of GnuCash, has pointed out that Homebrew simply uses the GnuCash dmg for its installation. That dmg does not include python bindings, so the answer to your question is "No, Homebrew does not include python. You would need to clozapine GnuCash yourself." David T. Original Message From: Hal Vaughan Sent: Fri May 01 01:32:14 GMT+05:30 2020 To: Gnucash Subject: Re: [GNC] Adding Transactions From Another Program Actually, this has me looking over what I am and am not still using. Since Mac is still using Python 2.7, but Catalina is coming up and that includes Python 3.x. So I’m looking over what I use and what I don’t among my decades of scripts. Last I looked, pretty much every system like that usurped the originals. At the time, when I looked them over, it became clear to me why they did that and it made sense. But, again, that decision was something like 10 years ago and I haven’t had time or cause to revisit it - until now. Do you know if Homebrew can provide the Python bindings for GC? Hal > On Apr 30, 2020, at 2:27 AM, Adrien Monteleone > wrote: > > Have you investigated Homebrew vs. MacPorts? > > Just curious if the Perl issues are the same. > > Regards, > Adrien > >> On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan wrote: >> >> I’ve checked out the bindings - as I mentioned in my original post, the >> problem is that using the bindings on a Mac requires MacPorts. I’ve had >> issues before, since MacPorts (and other similar systems) usurp some of the >> normal paths for things like Perl and Python. I don’t use Perl for coding >> anymore, but I have Perl scripts I’ve been using for over a decade that do >> some simple work for me. I had an important Perl script I was using that >> used a specific Perl library. I don’t remember which one it was, but when I >> added MacPorts and tried to run my script a week later, it crashed. >> >> I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the >> normal system paths for scripting languages. When I installed it, and it >> took over for Perl, it put in a system without all the libraries my scripts >> used and some of the libraries that were available to me with a standard >> Perl install (libraries I had installed from CPAN) would not install in the >> new system. I had to completely remove MacPorts to get my old scripts to >> work. >> >> I’d love to use MacPorts, since it makes a lot available to me that I can’t >> easily add now (unless I start using a Linux VM), but that experience taught >> me never to trust such a system. >> >> I think it would be a lot easier for me to do this with Python bindings, but >> I still use older scripts for things I need to do once a month or once a >> year and I don’t want to risk breaking them again like they broke about a >> decade ago when I installed MacPorts. >> >> >> Hal > > > ___ > gnucash-user mailing list > gnucash-user@gnucash.org > To update your subscription preferences or to unsubscribe: > https://lists.gnucash.org/mailman/listinfo/gnucash-user > If you are using Nabble or Gmane, please see > https://wiki.gnucash.org/wiki/Mailing_Lists for more information. > - > Please remember to CC this list on all your replies. > You can do this by using Reply-To-List or Reply-All. > ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All. ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.
Re: [GNC] Adding Transactions From Another Program
Newsflash "Catalina is already here" :-) Python 2.7.16 is retained as "python" when upgrading to Catalina and Python 3.8.1 is also installed as "python3" so you can presumably use both in parallel. davidhalverson@Davids-MBP ~ % python3 --version Python 3.8.1 davidhalverson@Davids-MBP ~ % python --version Python 2.7.16 WARNING: Python 2.7 is not recommended. This version is included in macOS for compatibility with legacy software. Future versions of macOS will not include Python 2.7. Instead, it is recommended that you transition to using 'python3' from within Terminal. Python 2.7.16 (default, Feb 29 2020, 01:55:37) Cheers David. On Fri, 1 May 2020 at 06:04, Hal Vaughan wrote: > Actually, this has me looking over what I am and am not still using. > > Since Mac is still using Python 2.7, but Catalina is coming up and that > includes Python 3.x. So I’m looking over what I use and what I don’t among > my decades of scripts. > > Last I looked, pretty much every system like that usurped the originals. > At the time, when I looked them over, it became clear to me why they did > that and it made sense. But, again, that decision was something like 10 > years ago and I haven’t had time or cause to revisit it - until now. > > Do you know if Homebrew can provide the Python bindings for GC? > > > Hal > > > On Apr 30, 2020, at 2:27 AM, Adrien Monteleone < > adrien.montele...@lusfiber.net> wrote: > > > > Have you investigated Homebrew vs. MacPorts? > > > > Just curious if the Perl issues are the same. > > > > Regards, > > Adrien > > > >> On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan > wrote: > >> > >> I’ve checked out the bindings - as I mentioned in my original post, the > problem is that using the bindings on a Mac requires MacPorts. I’ve had > issues before, since MacPorts (and other similar systems) usurp some of the > normal paths for things like Perl and Python. I don’t use Perl for coding > anymore, but I have Perl scripts I’ve been using for over a decade that do > some simple work for me. I had an important Perl script I was using that > used a specific Perl library. I don’t remember which one it was, but when > I added MacPorts and tried to run my script a week later, it crashed. > >> > >> I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the > normal system paths for scripting languages. When I installed it, and it > took over for Perl, it put in a system without all the libraries my scripts > used and some of the libraries that were available to me with a standard > Perl install (libraries I had installed from CPAN) would not install in the > new system. I had to completely remove MacPorts to get my old scripts to > work. > >> > >> I’d love to use MacPorts, since it makes a lot available to me that I > can’t easily add now (unless I start using a Linux VM), but that experience > taught me never to trust such a system. > >> > >> I think it would be a lot easier for me to do this with Python > bindings, but I still use older scripts for things I need to do once a > month or once a year and I don’t want to risk breaking them again like they > broke about a decade ago when I installed MacPorts. > >> > >> > >> Hal > > > > > > ___ > > gnucash-user mailing list > > gnucash-user@gnucash.org > > To update your subscription preferences or to unsubscribe: > > https://lists.gnucash.org/mailman/listinfo/gnucash-user > > If you are using Nabble or Gmane, please see > https://wiki.gnucash.org/wiki/Mailing_Lists for more information. > > - > > Please remember to CC this list on all your replies. > > You can do this by using Reply-To-List or Reply-All. > > > > ___ > gnucash-user mailing list > gnucash-user@gnucash.org > To update your subscription preferences or to unsubscribe: > https://lists.gnucash.org/mailman/listinfo/gnucash-user > If you are using Nabble or Gmane, please see > https://wiki.gnucash.org/wiki/Mailing_Lists for more information. > - > Please remember to CC this list on all your replies. > You can do this by using Reply-To-List or Reply-All. > ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.
Re: [GNC] Adding Transactions From Another Program
Actually, this has me looking over what I am and am not still using. Since Mac is still using Python 2.7, but Catalina is coming up and that includes Python 3.x. So I’m looking over what I use and what I don’t among my decades of scripts. Last I looked, pretty much every system like that usurped the originals. At the time, when I looked them over, it became clear to me why they did that and it made sense. But, again, that decision was something like 10 years ago and I haven’t had time or cause to revisit it - until now. Do you know if Homebrew can provide the Python bindings for GC? Hal > On Apr 30, 2020, at 2:27 AM, Adrien Monteleone > wrote: > > Have you investigated Homebrew vs. MacPorts? > > Just curious if the Perl issues are the same. > > Regards, > Adrien > >> On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan wrote: >> >> I’ve checked out the bindings - as I mentioned in my original post, the >> problem is that using the bindings on a Mac requires MacPorts. I’ve had >> issues before, since MacPorts (and other similar systems) usurp some of the >> normal paths for things like Perl and Python. I don’t use Perl for coding >> anymore, but I have Perl scripts I’ve been using for over a decade that do >> some simple work for me. I had an important Perl script I was using that >> used a specific Perl library. I don’t remember which one it was, but when I >> added MacPorts and tried to run my script a week later, it crashed. >> >> I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the >> normal system paths for scripting languages. When I installed it, and it >> took over for Perl, it put in a system without all the libraries my scripts >> used and some of the libraries that were available to me with a standard >> Perl install (libraries I had installed from CPAN) would not install in the >> new system. I had to completely remove MacPorts to get my old scripts to >> work. >> >> I’d love to use MacPorts, since it makes a lot available to me that I can’t >> easily add now (unless I start using a Linux VM), but that experience taught >> me never to trust such a system. >> >> I think it would be a lot easier for me to do this with Python bindings, but >> I still use older scripts for things I need to do once a month or once a >> year and I don’t want to risk breaking them again like they broke about a >> decade ago when I installed MacPorts. >> >> >> Hal > > > ___ > gnucash-user mailing list > gnucash-user@gnucash.org > To update your subscription preferences or to unsubscribe: > https://lists.gnucash.org/mailman/listinfo/gnucash-user > If you are using Nabble or Gmane, please see > https://wiki.gnucash.org/wiki/Mailing_Lists for more information. > - > Please remember to CC this list on all your replies. > You can do this by using Reply-To-List or Reply-All. > ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.
Re: [GNC] Adding Transactions From Another Program
We don't build the python bindings in the MacOS or Windows bundles because they must be linked to libpython, and it obviously has to be the same libpython to which the python executing the user's program is linked to. You can see where that's going: We'd have to include an entire python installation in the bundle. For MacOS, Homebrew's Gnucash recipe is a fake: It just downloads our dmg. You could use it to build as many of the dependencies as it supports and then build the rest plus GnuCash. It *does* pollute your environment like MacPorts and Fink do. The simplest way around that is to create a separate user for whichever Linux-clone you want to use. That user's environment will be altered but your primary account won't be. Another possibility, and the one we recommend for the python bindings, is to build GnuCash yourself. We have pretty well automated build systems at https://github.com/Gnucash/gnucash-on-osx and https://github.com/Gnucash/gnucash-on-windows. The budget code is not wrapped for Python or Guile. Regards, John Ralls > On Apr 30, 2020, at 7:18 AM, Stu Perlman wrote: > > David, are the Python bindings not supported in Windows? I don't see any > mention of Windows setup on this page: > https://wiki.gnucash.org/wiki/Python_Bindings#Setting_things_up I do have > Python 3.8 on my Win 10 system. > > My second question is with regard to budgets. If I don't see anything > regarding GC's budget module on these two pages: > https://code.gnucash.org/docs/MAINT/gnucash__core_8py.html > https://github.com/Gnucash/gnucash/tree/master/bindings/python/example_scripts > > Does that absence of info on Python and budgets mean that bindings are not > available for the budget module at this time? > > > > On Tue, Apr 28, 2020 at 6:07 PM Stu Perlman wrote: > >> David, I did look at the Python bindings info a while back but at the time >> did not feel like getting started with Python because I just wanted to get >> done what I wanted to get done. I'm mostly a .NET & SQL guy so I stuck >> with what I knew. Fast forward a few months and add in the bounty of extra >> time that the quarantine has afforded and I have since started dipping my >> toes into Python a bit. I'm actually kind of excited now to take a fresh >> look at the Python bindings capabilities for GC. I agree with you 100% >> that there may be no need for me nor for Hal to do our own things if there >> is an existing way! >> >> >> On Tue, Apr 28, 2020 at 5:59 PM David H wrote: >> >>> Have you checked out the GnuCash Python Bindings - >>> https://code.gnucash.org/docs/MAINT/python_bindings_page.html - no point >>> in re-inventing the wheel :-) >>> >>> Cheers David H. >>> >>> What can Python Bindings be used for ? >>> >>> The python bindings supply the ability to access a wide range of the core >>> functions of GnuCash. You can read and write Transactions, Commodities, >>> Lots, access the business stuff... You gain the ability to manipulate your >>> financial data with a flexible scripting language. >>> >>> Not everything GnuCash can is possible to access though. The bindings >>> focus on basic accounting functions. Have a look at the examples to get an >>> impression. >>> >>> Some functions are broken because they have not been wrapped properly. >>> They may crash the program or return unaccessible values. Please file a bug >>> report if you find one to help support the development process. >>> >>> On Wed, 29 Apr 2020 at 07:44, Stu Perlman wrote: >>> Hal, I'm sort of doing a liter version of what you are describing. I do manipulate some GC data from outside of GC. I have GC setup with the MySQL backend and while I don't create any new transactions from outside of GC I do manipulate them. I have some SQL routines that I created to clean up data points such as the Memo & Notes attributes that are part of each transaction. I have not run into any problems or data corruption after a few months of doing this. I did put a circuit breaker into my bolt-on app that at startup the 1st thing it does it check the GC lock record and if it detects that GC may still be running it will not allow my SQL routines to do anything. INSERTING new transaction records using SQL on the surface appears like it should be simple enough but I would proceed with extreme caution and a lot of testing as you go. I did not try creating any new transactions but I did try to create my own little routine (and then abandoned the effort) to let me set monthly budget amounts. *The reasons for that attempt are not important to this thread but the outcome may be*. I gave up after spending time creating the logic that I needed to insert into and/or change records in the SQL table [budget_amounts]. Everything I tested always looked perfect in the SQL backend until I went to work with that
Re: [GNC] Adding Transactions From Another Program
David, are the Python bindings not supported in Windows? I don't see any mention of Windows setup on this page: https://wiki.gnucash.org/wiki/Python_Bindings#Setting_things_up I do have Python 3.8 on my Win 10 system. My second question is with regard to budgets. If I don't see anything regarding GC's budget module on these two pages: https://code.gnucash.org/docs/MAINT/gnucash__core_8py.html https://github.com/Gnucash/gnucash/tree/master/bindings/python/example_scripts Does that absence of info on Python and budgets mean that bindings are not available for the budget module at this time? On Tue, Apr 28, 2020 at 6:07 PM Stu Perlman wrote: > David, I did look at the Python bindings info a while back but at the time > did not feel like getting started with Python because I just wanted to get > done what I wanted to get done. I'm mostly a .NET & SQL guy so I stuck > with what I knew. Fast forward a few months and add in the bounty of extra > time that the quarantine has afforded and I have since started dipping my > toes into Python a bit. I'm actually kind of excited now to take a fresh > look at the Python bindings capabilities for GC. I agree with you 100% > that there may be no need for me nor for Hal to do our own things if there > is an existing way! > > > On Tue, Apr 28, 2020 at 5:59 PM David H wrote: > >> Have you checked out the GnuCash Python Bindings - >> https://code.gnucash.org/docs/MAINT/python_bindings_page.html - no point >> in re-inventing the wheel :-) >> >> Cheers David H. >> >> What can Python Bindings be used for ? >> >> The python bindings supply the ability to access a wide range of the core >> functions of GnuCash. You can read and write Transactions, Commodities, >> Lots, access the business stuff... You gain the ability to manipulate your >> financial data with a flexible scripting language. >> >> Not everything GnuCash can is possible to access though. The bindings >> focus on basic accounting functions. Have a look at the examples to get an >> impression. >> >> Some functions are broken because they have not been wrapped properly. >> They may crash the program or return unaccessible values. Please file a bug >> report if you find one to help support the development process. >> >> On Wed, 29 Apr 2020 at 07:44, Stu Perlman wrote: >> >>> Hal, >>> >>> I'm sort of doing a liter version of what you are describing. I do >>> manipulate some GC data from outside of GC. I have GC setup with the >>> MySQL >>> backend and while I don't create any new transactions from outside of GC >>> I >>> do manipulate them. I have some SQL routines that I created to clean up >>> data points such as the Memo & Notes attributes that are part of each >>> transaction. I have not run into any problems or data corruption after a >>> few months of doing this. I did put a circuit breaker into my bolt-on >>> app >>> that at startup the 1st thing it does it check the GC lock record and if >>> it >>> detects that GC may still be running it will not allow my SQL routines to >>> do anything. >>> >>> INSERTING new transaction records using SQL on the surface appears like >>> it >>> should be simple enough but I would proceed with extreme caution and a >>> lot >>> of testing as you go. I did not try creating any new transactions but I >>> did try to create my own little routine (and then abandoned the effort) >>> to let me set monthly budget amounts. *The reasons for that attempt are >>> not >>> important to this thread but the outcome may be*. >>> >>> I gave up after spending time creating the logic that I needed to insert >>> into and/or change records in the SQL table [budget_amounts]. >>> Everything I >>> tested always looked perfect in the SQL backend until I went to work with >>> that data in GC. It was like I did not change anything behind the scenes >>> once I opened up GC again. I would go back to the SQL world and would >>> sometimes notice that my changes to [budget_amounts] were either being a) >>> ignored, b) wiped out or c) some other corruption. Through trial and >>> error, I discovered that the SQL table [slots] (and it's various >>> pseudo-tables) also maintains budget amount data and that said data in >>> [slots] will persist when GC is restarted after my changes from SQL were >>> executed. It was then that I decided that the amount of effort that I >>> would spend reverse engineering the logic that GC is using with the >>> [slots] >>> table was never going to be worth the reward nor the risk. >>> >>> I don't know for a fact that for your particular use case that writing to >>> [slots] will even be required because I never dug into the transactions >>> that deeply. Maybe [transactions] and [splits] are isolated from the >>> apparently superior related data that GC maintains in [slots]. If you >>> happen to know the languages that the GC engine is written in you might >>> be >>> able to get the answer with a little bit of code review instead of the >>> time >>> consumed doing a
Re: [GNC] Adding Transactions From Another Program
Have you investigated Homebrew vs. MacPorts? Just curious if the Perl issues are the same. Regards, Adrien > On Apr 30, 2020 w18d121, at 12:29 AM, Hal Vaughan wrote: > > I’ve checked out the bindings - as I mentioned in my original post, the > problem is that using the bindings on a Mac requires MacPorts. I’ve had > issues before, since MacPorts (and other similar systems) usurp some of the > normal paths for things like Perl and Python. I don’t use Perl for coding > anymore, but I have Perl scripts I’ve been using for over a decade that do > some simple work for me. I had an important Perl script I was using that > used a specific Perl library. I don’t remember which one it was, but when I > added MacPorts and tried to run my script a week later, it crashed. > > I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the > normal system paths for scripting languages. When I installed it, and it > took over for Perl, it put in a system without all the libraries my scripts > used and some of the libraries that were available to me with a standard Perl > install (libraries I had installed from CPAN) would not install in the new > system. I had to completely remove MacPorts to get my old scripts to work. > > I’d love to use MacPorts, since it makes a lot available to me that I can’t > easily add now (unless I start using a Linux VM), but that experience taught > me never to trust such a system. > > I think it would be a lot easier for me to do this with Python bindings, but > I still use older scripts for things I need to do once a month or once a year > and I don’t want to risk breaking them again like they broke about a decade > ago when I installed MacPorts. > > > Hal ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.
Re: [GNC] Adding Transactions From Another Program
Interesting! Did you consider having GC use XML in your save file instead of SQL? If I do pursue this, I’ll be glad to make the code available and let people know what happens. Hal > On Apr 28, 2020, at 5:41 PM, Stu Perlman wrote: > > Hal, > > I'm sort of doing a liter version of what you are describing. I do manipulate > some GC data from outside of GC. I have GC setup with the MySQL backend and > while I don't create any new transactions from outside of GC I do manipulate > them. I have some SQL routines that I created to clean up data points such as > the Memo & Notes attributes that are part of each transaction. I have not run > into any problems or data corruption after a few months of doing this. I did > put a circuit breaker into my bolt-on app that at startup the 1st thing it > does it check the GC lock record and if it detects that GC may still be > running it will not allow my SQL routines to do anything. > > INSERTING new transaction records using SQL on the surface appears like it > should be simple enough but I would proceed with extreme caution and a lot of > testing as you go. I did not try creating any new transactions but I did try > to create my own little routine (and then abandoned the effort) to let me > set monthly budget amounts. The reasons for that attempt are not important to > this thread but the outcome may be. > > I gave up after spending time creating the logic that I needed to insert into > and/or change records in the SQL table [budget_amounts]. Everything I tested > always looked perfect in the SQL backend until I went to work with that data > in GC. It was like I did not change anything behind the scenes once I opened > up GC again. I would go back to the SQL world and would sometimes notice > that my changes to [budget_amounts] were either being a) ignored, b) wiped > out or c) some other corruption. Through trial and error, I discovered that > the SQL table [slots] (and it's various pseudo-tables) also maintains budget > amount data and that said data in [slots] will persist when GC is restarted > after my changes from SQL were executed. It was then that I decided that the > amount of effort that I would spend reverse engineering the logic that GC is > using with the [slots] table was never going to be worth the reward nor the > risk. > > I don't know for a fact that for your particular use case that writing to > [slots] will even be required because I never dug into the transactions that > deeply. Maybe [transactions] and [splits] are isolated from the apparently > superior related data that GC maintains in [slots]. If you happen to know > the languages that the GC engine is written in you might be able to get the > answer with a little bit of code review instead of the time consumed doing a > bunch of testing, observing, and evaluating. > > Good luck! I'd love to know how it goes for you if you end up pursuing this > idea. > > - Stu > > > > On Tue, Apr 28, 2020 at 3:15 PM Hal Vaughan wrote: > I’ve done some research on this issue and I’m trying to determine if it’s > worth doing more or if I’d just spend time on this topic and find it won’t > work. > > I have a situation I’ve been told GnuCash can’t handle, but I have a Python > library that can handle it. (It has to do with calculating interest on a > credit line with a variable balance.) > > Years ago, I remember checking into GnuCash and reading the XML data files > and finding that each transaction seemed to have a UUID with it, but that the > other data in each entry would be easy to generate from my own library > written in Python. I also know that now the data files can be in SQL, using > several different engines, and that if it’s an XML file, it’s in gzip format. > > I do not need my program to run as a plug-in or anything like that. (Last I > looked, I had to install MacPorts for that, and last time I installed > MacPorts, it made a mess of the libraries for my old Perl scripts and some > Python ones.) > > But here’s what I’d like to do: > 1. Enter my transactions involving the credit line normally in GnuCash. > 2. Exit GnuCash > 3. Run my Python script that would read the GnuCash data file and find all > transactions with any credit lines. > 4. Do the interest calculations for my credit line > 5. Add a debit transaction for the interest amount before each new > transaction with the credit line > 6. Edit the comment field for each transaction involving the credit line to > include notes on interest and totals > 7. Save the ledger and exit my library script. > 8. Run GnuCash again and have the new transactions included and their amounts > included in any account totals. > > Is this even possible? I don’t mind doing the research to find out how to > generate a transaction ID and all the rest. I just want to know if I can use > my own library to add transactions to a file (or edit comments in a > transaction) and, when
Re: [GNC] Adding Transactions From Another Program
CVS works fine. I can still read the data I need to by opening the GC file with my script, checking to see what entries I’ve already added, and add the ones that are still needed to a temporary CSV file I import. That works fine. I just want don’t want to have to do the math. Eventually, after getting it working and verifying it works, I’ll look into if I can do that without exiting GC. Thanks! Hal > On Apr 28, 2020, at 4:51 PM, Adrien Monteleone > wrote: > > My understanding is it isn’t exactly ’safe’ to directly edit the data file > outside of the app. (this doesn’t mean you can’t, but don’t expect much > support if something breaks or data is destroyed) > > Since you are generating additional transactions, I’d just do that, in the > form of a CSV file for GnuCash to import. > > Do the import. > > This won’t get your memos updated in the existing transactions. > > > - > How often is the interest added to the account? > > There is a feature to input interest charges when reconciling. > > Scheduled Transactions also have the ability to use variables in formulas. > You could write a formula for the interest calculation and schedule it as > needed. This won’t auto-grab the existing balance, but if you use a variable > for ‘current_balance’ GnuCash will prompt you for that figure to use in the > formula. If the rate is also variable, then that too can be prompted. > > Unfortunately, there is no ’template transaction’ feature. (yet) These would > work like a Scheduled Transaction but instead fire on command as needed, not > according to a set schedule. The best alternative is to schedule it for a > reasonable time interval, but mark it not to be auto-created, but do opt for > the notification it is due. That way, you can choose when to create the > interest transaction, get prompted for the variable values, and then review > the transaction before committing it. > > Regards, > Adrien > >> On Apr 28, 2020 w18d119, at 2:11 PM, Hal Vaughan wrote: >> >> I’ve done some research on this issue and I’m trying to determine if it’s >> worth doing more or if I’d just spend time on this topic and find it won’t >> work. >> >> I have a situation I’ve been told GnuCash can’t handle, but I have a Python >> library that can handle it. (It has to do with calculating interest on a >> credit line with a variable balance.) >> >> Years ago, I remember checking into GnuCash and reading the XML data files >> and finding that each transaction seemed to have a UUID with it, but that >> the other data in each entry would be easy to generate from my own library >> written in Python. I also know that now the data files can be in SQL, using >> several different engines, and that if it’s an XML file, it’s in gzip format. >> >> I do not need my program to run as a plug-in or anything like that. (Last I >> looked, I had to install MacPorts for that, and last time I installed >> MacPorts, it made a mess of the libraries for my old Perl scripts and some >> Python ones.) >> >> But here’s what I’d like to do: >> 1. Enter my transactions involving the credit line normally in GnuCash. >> 2. Exit GnuCash >> 3. Run my Python script that would read the GnuCash data file and find all >> transactions with any credit lines. >> 4. Do the interest calculations for my credit line >> 5. Add a debit transaction for the interest amount before each new >> transaction with the credit line >> 6. Edit the comment field for each transaction involving the credit line to >> include notes on interest and totals >> 7. Save the ledger and exit my library script. >> 8. Run GnuCash again and have the new transactions included and their >> amounts included in any account totals. >> >> Is this even possible? I don’t mind doing the research to find out how to >> generate a transaction ID and all the rest. I just want to know if I can >> use my own library to add transactions to a file (or edit comments in a >> transaction) and, when I’m done, for GnuCash to be able to read that file, >> with my new transactions, in and to include the amounts in the added >> transactions in account totals. >> >> >> >> Hal > > ___ > gnucash-user mailing list > gnucash-user@gnucash.org > To update your subscription preferences or to unsubscribe: > https://lists.gnucash.org/mailman/listinfo/gnucash-user > If you are using Nabble or Gmane, please see > https://wiki.gnucash.org/wiki/Mailing_Lists for more information. > - > Please remember to CC this list on all your replies. > You can do this by using Reply-To-List or Reply-All. > ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please rememb
Re: [GNC] Adding Transactions From Another Program
I’ve checked out the bindings - as I mentioned in my original post, the problem is that using the bindings on a Mac requires MacPorts. I’ve had issues before, since MacPorts (and other similar systems) usurp some of the normal paths for things like Perl and Python. I don’t use Perl for coding anymore, but I have Perl scripts I’ve been using for over a decade that do some simple work for me. I had an important Perl script I was using that used a specific Perl library. I don’t remember which one it was, but when I added MacPorts and tried to run my script a week later, it crashed. I had no idea MacPorts, Fink, Homebrew, and similar systems usurped the normal system paths for scripting languages. When I installed it, and it took over for Perl, it put in a system without all the libraries my scripts used and some of the libraries that were available to me with a standard Perl install (libraries I had installed from CPAN) would not install in the new system. I had to completely remove MacPorts to get my old scripts to work. I’d love to use MacPorts, since it makes a lot available to me that I can’t easily add now (unless I start using a Linux VM), but that experience taught me never to trust such a system. I think it would be a lot easier for me to do this with Python bindings, but I still use older scripts for things I need to do once a month or once a year and I don’t want to risk breaking them again like they broke about a decade ago when I installed MacPorts. Hal > On Apr 28, 2020, at 5:58 PM, David H wrote: > > Have you checked out the GnuCash Python Bindings - > https://code.gnucash.org/docs/MAINT/python_bindings_page.html - no point in > re-inventing the wheel :-) > > Cheers David H. > > What can Python Bindings be used for ? > > The python bindings supply the ability to access a wide range of the core > functions of GnuCash. You can read and write Transactions, Commodities, Lots, > access the business stuff... You gain the ability to manipulate your > financial data with a flexible scripting language. > > Not everything GnuCash can is possible to access though. The bindings focus > on basic accounting functions. Have a look at the examples to get an > impression. > > Some functions are broken because they have not been wrapped properly. They > may crash the program or return unaccessible values. Please file a bug report > if you find one to help support the development process. > > > On Wed, 29 Apr 2020 at 07:44, Stu Perlman wrote: > Hal, > > I'm sort of doing a liter version of what you are describing. I do > manipulate some GC data from outside of GC. I have GC setup with the MySQL > backend and while I don't create any new transactions from outside of GC I > do manipulate them. I have some SQL routines that I created to clean up > data points such as the Memo & Notes attributes that are part of each > transaction. I have not run into any problems or data corruption after a > few months of doing this. I did put a circuit breaker into my bolt-on app > that at startup the 1st thing it does it check the GC lock record and if it > detects that GC may still be running it will not allow my SQL routines to > do anything. > > INSERTING new transaction records using SQL on the surface appears like it > should be simple enough but I would proceed with extreme caution and a lot > of testing as you go. I did not try creating any new transactions but I > did try to create my own little routine (and then abandoned the effort) > to let me set monthly budget amounts. *The reasons for that attempt are not > important to this thread but the outcome may be*. > > I gave up after spending time creating the logic that I needed to insert > into and/or change records in the SQL table [budget_amounts]. Everything I > tested always looked perfect in the SQL backend until I went to work with > that data in GC. It was like I did not change anything behind the scenes > once I opened up GC again. I would go back to the SQL world and would > sometimes notice that my changes to [budget_amounts] were either being a) > ignored, b) wiped out or c) some other corruption. Through trial and > error, I discovered that the SQL table [slots] (and it's various > pseudo-tables) also maintains budget amount data and that said data in > [slots] will persist when GC is restarted after my changes from SQL were > executed. It was then that I decided that the amount of effort that I > would spend reverse engineering the logic that GC is using with the [slots] > table was never going to be worth the reward nor the risk. > > I don't know for a fact that for your particular use case that writing to > [slots] will even be required because I never dug into the transactions > that deeply. Maybe [transactions] and [splits] are isolated from the > apparently superior related data that GC maintains in [slots]. If you > happen to know the languages that the GC engine is written in you might be >
Re: [GNC] Adding Transactions From Another Program
David, I did look at the Python bindings info a while back but at the time did not feel like getting started with Python because I just wanted to get done what I wanted to get done. I'm mostly a .NET & SQL guy so I stuck with what I knew. Fast forward a few months and add in the bounty of extra time that the quarantine has afforded and I have since started dipping my toes into Python a bit. I'm actually kind of excited now to take a fresh look at the Python bindings capabilities for GC. I agree with you 100% that there may be no need for me nor for Hal to do our own things if there is an existing way! On Tue, Apr 28, 2020 at 5:59 PM David H wrote: > Have you checked out the GnuCash Python Bindings - > https://code.gnucash.org/docs/MAINT/python_bindings_page.html - no point > in re-inventing the wheel :-) > > Cheers David H. > > What can Python Bindings be used for ? > > The python bindings supply the ability to access a wide range of the core > functions of GnuCash. You can read and write Transactions, Commodities, > Lots, access the business stuff... You gain the ability to manipulate your > financial data with a flexible scripting language. > > Not everything GnuCash can is possible to access though. The bindings > focus on basic accounting functions. Have a look at the examples to get an > impression. > > Some functions are broken because they have not been wrapped properly. > They may crash the program or return unaccessible values. Please file a bug > report if you find one to help support the development process. > > On Wed, 29 Apr 2020 at 07:44, Stu Perlman wrote: > >> Hal, >> >> I'm sort of doing a liter version of what you are describing. I do >> manipulate some GC data from outside of GC. I have GC setup with the >> MySQL >> backend and while I don't create any new transactions from outside of GC I >> do manipulate them. I have some SQL routines that I created to clean up >> data points such as the Memo & Notes attributes that are part of each >> transaction. I have not run into any problems or data corruption after a >> few months of doing this. I did put a circuit breaker into my bolt-on app >> that at startup the 1st thing it does it check the GC lock record and if >> it >> detects that GC may still be running it will not allow my SQL routines to >> do anything. >> >> INSERTING new transaction records using SQL on the surface appears like it >> should be simple enough but I would proceed with extreme caution and a lot >> of testing as you go. I did not try creating any new transactions but I >> did try to create my own little routine (and then abandoned the effort) >> to let me set monthly budget amounts. *The reasons for that attempt are >> not >> important to this thread but the outcome may be*. >> >> I gave up after spending time creating the logic that I needed to insert >> into and/or change records in the SQL table [budget_amounts]. Everything >> I >> tested always looked perfect in the SQL backend until I went to work with >> that data in GC. It was like I did not change anything behind the scenes >> once I opened up GC again. I would go back to the SQL world and would >> sometimes notice that my changes to [budget_amounts] were either being a) >> ignored, b) wiped out or c) some other corruption. Through trial and >> error, I discovered that the SQL table [slots] (and it's various >> pseudo-tables) also maintains budget amount data and that said data in >> [slots] will persist when GC is restarted after my changes from SQL were >> executed. It was then that I decided that the amount of effort that I >> would spend reverse engineering the logic that GC is using with the >> [slots] >> table was never going to be worth the reward nor the risk. >> >> I don't know for a fact that for your particular use case that writing to >> [slots] will even be required because I never dug into the transactions >> that deeply. Maybe [transactions] and [splits] are isolated from the >> apparently superior related data that GC maintains in [slots]. If you >> happen to know the languages that the GC engine is written in you might be >> able to get the answer with a little bit of code review instead of the >> time >> consumed doing a bunch of testing, observing, and evaluating. >> >> Good luck! I'd love to know how it goes for you if you end up pursuing >> this idea. >> >> - Stu >> >> >> >> On Tue, Apr 28, 2020 at 3:15 PM Hal Vaughan wrote: >> >> > I’ve done some research on this issue and I’m trying to determine if >> it’s >> > worth doing more or if I’d just spend time on this topic and find it >> won’t >> > work. >> > >> > I have a situation I’ve been told GnuCash can’t handle, but I have a >> > Python library that can handle it. (It has to do with calculating >> interest >> > on a credit line with a variable balance.) >> > >> > Years ago, I remember checking into GnuCash and reading the XML data >> files >> > and finding that each transaction seemed to have a UUID with it, but >> t
Re: [GNC] Adding Transactions From Another Program
Have you checked out the GnuCash Python Bindings - https://code.gnucash.org/docs/MAINT/python_bindings_page.html - no point in re-inventing the wheel :-) Cheers David H. What can Python Bindings be used for ? The python bindings supply the ability to access a wide range of the core functions of GnuCash. You can read and write Transactions, Commodities, Lots, access the business stuff... You gain the ability to manipulate your financial data with a flexible scripting language. Not everything GnuCash can is possible to access though. The bindings focus on basic accounting functions. Have a look at the examples to get an impression. Some functions are broken because they have not been wrapped properly. They may crash the program or return unaccessible values. Please file a bug report if you find one to help support the development process. On Wed, 29 Apr 2020 at 07:44, Stu Perlman wrote: > Hal, > > I'm sort of doing a liter version of what you are describing. I do > manipulate some GC data from outside of GC. I have GC setup with the MySQL > backend and while I don't create any new transactions from outside of GC I > do manipulate them. I have some SQL routines that I created to clean up > data points such as the Memo & Notes attributes that are part of each > transaction. I have not run into any problems or data corruption after a > few months of doing this. I did put a circuit breaker into my bolt-on app > that at startup the 1st thing it does it check the GC lock record and if it > detects that GC may still be running it will not allow my SQL routines to > do anything. > > INSERTING new transaction records using SQL on the surface appears like it > should be simple enough but I would proceed with extreme caution and a lot > of testing as you go. I did not try creating any new transactions but I > did try to create my own little routine (and then abandoned the effort) > to let me set monthly budget amounts. *The reasons for that attempt are not > important to this thread but the outcome may be*. > > I gave up after spending time creating the logic that I needed to insert > into and/or change records in the SQL table [budget_amounts]. Everything I > tested always looked perfect in the SQL backend until I went to work with > that data in GC. It was like I did not change anything behind the scenes > once I opened up GC again. I would go back to the SQL world and would > sometimes notice that my changes to [budget_amounts] were either being a) > ignored, b) wiped out or c) some other corruption. Through trial and > error, I discovered that the SQL table [slots] (and it's various > pseudo-tables) also maintains budget amount data and that said data in > [slots] will persist when GC is restarted after my changes from SQL were > executed. It was then that I decided that the amount of effort that I > would spend reverse engineering the logic that GC is using with the [slots] > table was never going to be worth the reward nor the risk. > > I don't know for a fact that for your particular use case that writing to > [slots] will even be required because I never dug into the transactions > that deeply. Maybe [transactions] and [splits] are isolated from the > apparently superior related data that GC maintains in [slots]. If you > happen to know the languages that the GC engine is written in you might be > able to get the answer with a little bit of code review instead of the time > consumed doing a bunch of testing, observing, and evaluating. > > Good luck! I'd love to know how it goes for you if you end up pursuing > this idea. > > - Stu > > > > On Tue, Apr 28, 2020 at 3:15 PM Hal Vaughan wrote: > > > I’ve done some research on this issue and I’m trying to determine if it’s > > worth doing more or if I’d just spend time on this topic and find it > won’t > > work. > > > > I have a situation I’ve been told GnuCash can’t handle, but I have a > > Python library that can handle it. (It has to do with calculating > interest > > on a credit line with a variable balance.) > > > > Years ago, I remember checking into GnuCash and reading the XML data > files > > and finding that each transaction seemed to have a UUID with it, but that > > the other data in each entry would be easy to generate from my own > library > > written in Python. I also know that now the data files can be in SQL, > > using several different engines, and that if it’s an XML file, it’s in > gzip > > format. > > > > I do not need my program to run as a plug-in or anything like that. > (Last > > I looked, I had to install MacPorts for that, and last time I installed > > MacPorts, it made a mess of the libraries for my old Perl scripts and > some > > Python ones.) > > > > But here’s what I’d like to do: > > 1. Enter my transactions involving the credit line normally in GnuCash. > > 2. Exit GnuCash > > 3. Run my Python script that would read the GnuCash data file and find > all > > transactions with any credit lines. > > 4. Do the interes
Re: [GNC] Adding Transactions From Another Program
Hal, I'm sort of doing a liter version of what you are describing. I do manipulate some GC data from outside of GC. I have GC setup with the MySQL backend and while I don't create any new transactions from outside of GC I do manipulate them. I have some SQL routines that I created to clean up data points such as the Memo & Notes attributes that are part of each transaction. I have not run into any problems or data corruption after a few months of doing this. I did put a circuit breaker into my bolt-on app that at startup the 1st thing it does it check the GC lock record and if it detects that GC may still be running it will not allow my SQL routines to do anything. INSERTING new transaction records using SQL on the surface appears like it should be simple enough but I would proceed with extreme caution and a lot of testing as you go. I did not try creating any new transactions but I did try to create my own little routine (and then abandoned the effort) to let me set monthly budget amounts. *The reasons for that attempt are not important to this thread but the outcome may be*. I gave up after spending time creating the logic that I needed to insert into and/or change records in the SQL table [budget_amounts]. Everything I tested always looked perfect in the SQL backend until I went to work with that data in GC. It was like I did not change anything behind the scenes once I opened up GC again. I would go back to the SQL world and would sometimes notice that my changes to [budget_amounts] were either being a) ignored, b) wiped out or c) some other corruption. Through trial and error, I discovered that the SQL table [slots] (and it's various pseudo-tables) also maintains budget amount data and that said data in [slots] will persist when GC is restarted after my changes from SQL were executed. It was then that I decided that the amount of effort that I would spend reverse engineering the logic that GC is using with the [slots] table was never going to be worth the reward nor the risk. I don't know for a fact that for your particular use case that writing to [slots] will even be required because I never dug into the transactions that deeply. Maybe [transactions] and [splits] are isolated from the apparently superior related data that GC maintains in [slots]. If you happen to know the languages that the GC engine is written in you might be able to get the answer with a little bit of code review instead of the time consumed doing a bunch of testing, observing, and evaluating. Good luck! I'd love to know how it goes for you if you end up pursuing this idea. - Stu On Tue, Apr 28, 2020 at 3:15 PM Hal Vaughan wrote: > I’ve done some research on this issue and I’m trying to determine if it’s > worth doing more or if I’d just spend time on this topic and find it won’t > work. > > I have a situation I’ve been told GnuCash can’t handle, but I have a > Python library that can handle it. (It has to do with calculating interest > on a credit line with a variable balance.) > > Years ago, I remember checking into GnuCash and reading the XML data files > and finding that each transaction seemed to have a UUID with it, but that > the other data in each entry would be easy to generate from my own library > written in Python. I also know that now the data files can be in SQL, > using several different engines, and that if it’s an XML file, it’s in gzip > format. > > I do not need my program to run as a plug-in or anything like that. (Last > I looked, I had to install MacPorts for that, and last time I installed > MacPorts, it made a mess of the libraries for my old Perl scripts and some > Python ones.) > > But here’s what I’d like to do: > 1. Enter my transactions involving the credit line normally in GnuCash. > 2. Exit GnuCash > 3. Run my Python script that would read the GnuCash data file and find all > transactions with any credit lines. > 4. Do the interest calculations for my credit line > 5. Add a debit transaction for the interest amount before each new > transaction with the credit line > 6. Edit the comment field for each transaction involving the credit line > to include notes on interest and totals > 7. Save the ledger and exit my library script. > 8. Run GnuCash again and have the new transactions included and their > amounts included in any account totals. > > Is this even possible? I don’t mind doing the research to find out how to > generate a transaction ID and all the rest. I just want to know if I can > use my own library to add transactions to a file (or edit comments in a > transaction) and, when I’m done, for GnuCash to be able to read that file, > with my new transactions, in and to include the amounts in the added > transactions in account totals. > > > > Hal > ___ > gnucash-user mailing list > gnucash-user@gnucash.org > To update your subscription preferences or to unsubscribe: > https://lists.gnucash.org/mailman/listinfo/gnucash-user
Re: [GNC] Adding Transactions From Another Program
My understanding is it isn’t exactly ’safe’ to directly edit the data file outside of the app. (this doesn’t mean you can’t, but don’t expect much support if something breaks or data is destroyed) Since you are generating additional transactions, I’d just do that, in the form of a CSV file for GnuCash to import. Do the import. This won’t get your memos updated in the existing transactions. - How often is the interest added to the account? There is a feature to input interest charges when reconciling. Scheduled Transactions also have the ability to use variables in formulas. You could write a formula for the interest calculation and schedule it as needed. This won’t auto-grab the existing balance, but if you use a variable for ‘current_balance’ GnuCash will prompt you for that figure to use in the formula. If the rate is also variable, then that too can be prompted. Unfortunately, there is no ’template transaction’ feature. (yet) These would work like a Scheduled Transaction but instead fire on command as needed, not according to a set schedule. The best alternative is to schedule it for a reasonable time interval, but mark it not to be auto-created, but do opt for the notification it is due. That way, you can choose when to create the interest transaction, get prompted for the variable values, and then review the transaction before committing it. Regards, Adrien > On Apr 28, 2020 w18d119, at 2:11 PM, Hal Vaughan wrote: > > I’ve done some research on this issue and I’m trying to determine if it’s > worth doing more or if I’d just spend time on this topic and find it won’t > work. > > I have a situation I’ve been told GnuCash can’t handle, but I have a Python > library that can handle it. (It has to do with calculating interest on a > credit line with a variable balance.) > > Years ago, I remember checking into GnuCash and reading the XML data files > and finding that each transaction seemed to have a UUID with it, but that the > other data in each entry would be easy to generate from my own library > written in Python. I also know that now the data files can be in SQL, using > several different engines, and that if it’s an XML file, it’s in gzip format. > > I do not need my program to run as a plug-in or anything like that. (Last I > looked, I had to install MacPorts for that, and last time I installed > MacPorts, it made a mess of the libraries for my old Perl scripts and some > Python ones.) > > But here’s what I’d like to do: > 1. Enter my transactions involving the credit line normally in GnuCash. > 2. Exit GnuCash > 3. Run my Python script that would read the GnuCash data file and find all > transactions with any credit lines. > 4. Do the interest calculations for my credit line > 5. Add a debit transaction for the interest amount before each new > transaction with the credit line > 6. Edit the comment field for each transaction involving the credit line to > include notes on interest and totals > 7. Save the ledger and exit my library script. > 8. Run GnuCash again and have the new transactions included and their amounts > included in any account totals. > > Is this even possible? I don’t mind doing the research to find out how to > generate a transaction ID and all the rest. I just want to know if I can use > my own library to add transactions to a file (or edit comments in a > transaction) and, when I’m done, for GnuCash to be able to read that file, > with my new transactions, in and to include the amounts in the added > transactions in account totals. > > > > Hal ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.
[GNC] Adding Transactions From Another Program
I’ve done some research on this issue and I’m trying to determine if it’s worth doing more or if I’d just spend time on this topic and find it won’t work. I have a situation I’ve been told GnuCash can’t handle, but I have a Python library that can handle it. (It has to do with calculating interest on a credit line with a variable balance.) Years ago, I remember checking into GnuCash and reading the XML data files and finding that each transaction seemed to have a UUID with it, but that the other data in each entry would be easy to generate from my own library written in Python. I also know that now the data files can be in SQL, using several different engines, and that if it’s an XML file, it’s in gzip format. I do not need my program to run as a plug-in or anything like that. (Last I looked, I had to install MacPorts for that, and last time I installed MacPorts, it made a mess of the libraries for my old Perl scripts and some Python ones.) But here’s what I’d like to do: 1. Enter my transactions involving the credit line normally in GnuCash. 2. Exit GnuCash 3. Run my Python script that would read the GnuCash data file and find all transactions with any credit lines. 4. Do the interest calculations for my credit line 5. Add a debit transaction for the interest amount before each new transaction with the credit line 6. Edit the comment field for each transaction involving the credit line to include notes on interest and totals 7. Save the ledger and exit my library script. 8. Run GnuCash again and have the new transactions included and their amounts included in any account totals. Is this even possible? I don’t mind doing the research to find out how to generate a transaction ID and all the rest. I just want to know if I can use my own library to add transactions to a file (or edit comments in a transaction) and, when I’m done, for GnuCash to be able to read that file, with my new transactions, in and to include the amounts in the added transactions in account totals. Hal ___ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information. - Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.