Re: [GNC] gnucash-cli --quotes get
On 2021-05-27 10:50 a.m., John Ralls wrote: On May 27, 2021, at 10:35 AM, Cam Ellison wrote: On 2021-05-27 10:08 a.m., mike823 wrote: Hi Robin, I used your code to load quotes and I've noticed that when runs multiple times, it will create multiple quote records for the same day. Any way to avoid this behavior? I mean, if you re-run it, it should just update the quote for the day, not create a new one. Thanks. And for those who do day trading, for example, and want to track prices at different times of day? It does what it should, which is to create a record each time it is run. But that's not what GnuCash is designed for and if you try to use it that way you'll pretty quickly run into performance problems. You're much better off getting a portfolio management tool for that kind of thing. Of course - I should have added that disclaimer. Not many of us have unlimited bandwidth. Cheers Cam ___ 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] gnucash-cli --quotes get
I’m also only interested in the market closing price. The question is how will GnuCash handle multiple quotes for one day. Which one will actually be used to valuate the portfolio? -- Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html ___ 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] gnucash-cli --quotes get
It’s probably possible, but getting the script this far is at the far frontier of my Python abilities. Plus, for my purposes, I’m only interested in the market closing price so I only run the script once per day, Tues-Sat. I don’t need an intraday level of granularity. Cheers, Robin On Thu, May 27, 2021 at 12:08 PM mike823 wrote: > Hi Robin, > > I used your code to load quotes and I've noticed that when runs multiple > times, it will create multiple quote records for the same day. Any way to > avoid this behavior? I mean, if you re-run it, it should just update the > quote for the day, not create a new one. > > Thanks. > > > > -- > Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html > ___ > 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. > -- --- Typed with my thumbs and sent from my iPad. ___ 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] gnucash-cli --quotes get
> On May 27, 2021, at 10:35 AM, Cam Ellison wrote: > > On 2021-05-27 10:08 a.m., mike823 wrote: >> Hi Robin, >> >> I used your code to load quotes and I've noticed that when runs multiple >> times, it will create multiple quote records for the same day. Any way to >> avoid this behavior? I mean, if you re-run it, it should just update the >> quote for the day, not create a new one. >> >> Thanks. >> > And for those who do day trading, for example, and want to track prices at > different times of day? > > It does what it should, which is to create a record each time it is run. But that's not what GnuCash is designed for and if you try to use it that way you'll pretty quickly run into performance problems. You're much better off getting a portfolio management tool for that kind of thing. Regards, John Ralls ___ 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] gnucash-cli --quotes get
On 2021-05-27 10:08 a.m., mike823 wrote: Hi Robin, I used your code to load quotes and I've noticed that when runs multiple times, it will create multiple quote records for the same day. Any way to avoid this behavior? I mean, if you re-run it, it should just update the quote for the day, not create a new one. Thanks. And for those who do day trading, for example, and want to track prices at different times of day? It does what it should, which is to create a record each time it is run. Cheers Cam ___ 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] gnucash-cli --quotes get
Hi Robin, I used your code to load quotes and I've noticed that when runs multiple times, it will create multiple quote records for the same day. Any way to avoid this behavior? I mean, if you re-run it, it should just update the quote for the day, not create a new one. Thanks. -- Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html ___ 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] gnucash-cli --quotes get
I have not done it myself but according to the docs you have to compile it yourself with the option enabled: https://www.gnucash.org/docs/v4/C/gnucash-guide/ch_python_bindings.html https://wiki.gnucash.org/wiki/Python_Bindings On Tue, May 18, 2021 at 11:27 AM mike823 wrote: > Are GnuCash with python bindings binaries available anywhere? > > > > -- > Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html > ___ > 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] gnucash-cli --quotes get
Is there a build for GnuCash with python bindings (binaries) available anywhere? -- Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html ___ 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] gnucash-cli --quotes get
Are GnuCash with python bindings binaries available anywhere? -- Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html ___ 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] gnucash-cli --quotes get
Thank you. -- Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html ___ 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] gnucash-cli --quotes get
Here's the file; I think the attachment should pass through, the input CSV has no headers and comma separated values in order below: Example: Mnemonic, Price, Price Date (-mm-dd), Namespace, Currency Code "94986H103",62.8194,2021-05-14,"401K","USD" It works for me, in lines 10-12, you can adjust the file paths for your input file and gnucash files. As for creating the CSV file, I have different scripts for that using Beautiful Soup or json to scrape either a website or API. I'm open to suggestions on how it could be made better if anyone else wants to take a look. Maybe I could even offer it up On Mon, May 17, 2021 at 6:33 PM mike823 wrote: > I use a SQLite backend and I would love to test your script. Could you > email > it to me? Thanks. > > > > -- > Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html > ___ > 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-price-import.py Description: Binary data ___ 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] gnucash-cli --quotes get
And I wrote a Python scripts and a BASH script that scrapes the prices off of the webpage and creates csv file. On 5/17/21 5:28 PM, Robin Chattopadhyay wrote: I have a Python script that I've created that takes in a CSV file and loads the prices into Gnucash. I would be willing to share it; I know it works with the SQLite backend, I haven't tested it with any other backend. Robin On Mon, May 17, 2021 at 6:59 AM mike823 wrote: I might do it. I am looking in gnucash/gnucash-cli.cpp and I see the code bellow in Gnucash::GnucashCli::start . Is another developer already working on the same functionality? if (m_quotes_cmd) { if (*m_quotes_cmd != "get") { std::cerr << bl::format (bl::translate("Unknown quotes command '{1}'")) % *m_quotes_cmd << "\n\n" << *m_opt_desc_display.get(); return 1; } if (!m_file_to_load || m_file_to_load->empty()) { std::cerr << bl::translate("Missing data file parameter") << "\n\n" << *m_opt_desc_display.get(); return 1; } else return Gnucash::add_quotes (m_file_to_load); } -- Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html ___ 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. -- Old Unix programmers never die, they just mv to /dev/null - Anonymous ___ 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] gnucash-cli --quotes get
I use a SQLite backend and I would love to test your script. Could you email it to me? Thanks. -- Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html ___ 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] gnucash-cli --quotes get
I have a Python script that I've created that takes in a CSV file and loads the prices into Gnucash. I would be willing to share it; I know it works with the SQLite backend, I haven't tested it with any other backend. Robin On Mon, May 17, 2021 at 6:59 AM mike823 wrote: > I might do it. I am looking in gnucash/gnucash-cli.cpp and I see the code > bellow in Gnucash::GnucashCli::start . Is another developer already working > on the same functionality? > > > > if (m_quotes_cmd) > { > if (*m_quotes_cmd != "get") > { > std::cerr << bl::format (bl::translate("Unknown quotes command > '{1}'")) % *m_quotes_cmd << "\n\n" > << *m_opt_desc_display.get(); > return 1; > } > > if (!m_file_to_load || m_file_to_load->empty()) > { > std::cerr << bl::translate("Missing data file parameter") << > "\n\n" > << *m_opt_desc_display.get(); > return 1; > } > else > return Gnucash::add_quotes (m_file_to_load); > } > > > > > -- > Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html > ___ > 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] gnucash-cli --quotes get
> On May 17, 2021, at 4:58 AM, mike823 wrote: > > I might do it. I am looking in gnucash/gnucash-cli.cpp and I see the code > bellow in Gnucash::GnucashCli::start . Is another developer already working > on the same functionality? > > > >if (m_quotes_cmd) >{ >if (*m_quotes_cmd != "get") >{ >std::cerr << bl::format (bl::translate("Unknown quotes command > '{1}'")) % *m_quotes_cmd << "\n\n" ><< *m_opt_desc_display.get(); >return 1; >} > >if (!m_file_to_load || m_file_to_load->empty()) >{ >std::cerr << bl::translate("Missing data file parameter") << > "\n\n" > << *m_opt_desc_display.get(); >return 1; >} >else >return Gnucash::add_quotes (m_file_to_load); >} > Not that I know of, but don't overload --get-quotes, write a new command named something like --import-quotes and have it call the same function that File>Import>Import Prices from a CSV File does. Regards, John Ralls ___ 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] gnucash-cli --quotes get
I might do it. I am looking in gnucash/gnucash-cli.cpp and I see the code bellow in Gnucash::GnucashCli::start . Is another developer already working on the same functionality? if (m_quotes_cmd) { if (*m_quotes_cmd != "get") { std::cerr << bl::format (bl::translate("Unknown quotes command '{1}'")) % *m_quotes_cmd << "\n\n" << *m_opt_desc_display.get(); return 1; } if (!m_file_to_load || m_file_to_load->empty()) { std::cerr << bl::translate("Missing data file parameter") << "\n\n" << *m_opt_desc_display.get(); return 1; } else return Gnucash::add_quotes (m_file_to_load); } -- Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html ___ 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] gnucash-cli --quotes get
No, --quotes-get runs finance quote. Importing via the command line is not yet implemented and AFAIK isn't on any core developer's todo list, so you're welcome to jump in and provide a pull request. Regards, John Ralls > On May 16, 2021, at 4:10 PM, mike823 wrote: > > Can "gnucash-cli --quotes get" load quotes from a file, like the import > prices from CSV does? Thanks. > > > > -- > Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html > ___ > 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.