Hi, this would be very useful to me, unfortunately it seems to be waiting for review/merge. What's the status? Is there anything I could do to help?
Alternatively, does anyone know if there a tool that does something similar but is outside of beancount main repository? (I'm not a fan of maintaining my own fork of beancount for this patch) On Sunday, September 15, 2019 at 7:06:57 PM UTC+2, Vivek Gani wrote: > > Hi, I've tried extending bean-price to have a --update option which can be > found at > https://bitbucket.org/seltzered/beancount/branch/bean-price-update . > Essentially it will look at commodity lifetimes and the last fetched price > to fetch up to (but not including) the present date. > > The motivations for this were: > - Previously it seemed like most would write their own bespoke script > for price updates. > - It seemed like others had interest in a --update feature- see Johannes > Harms comments in > https://bitbucket.org/blais/beancount/issues/329/bean-price-support-fetch-over-range-of > > I initially had a branch for specifying a "--date-range" option but having > something that looked into commodity lifetimes and prices to find the dates > to update seemed more useful. > - There was some hinting of a making a 'historical price fetcher' > routine in lifetimes.py already. There's also been experiments like > fetch-lifetime-prices.py. > > Features: > - By default it fetches for 'weekday' prices, but one can set the > --update-rate to 'weekly' or 'daily' instead. > - You can use the existing --date option to fetch up to a specific final > date. Could be helpful if you really want to fetch inclusive of today. > - You can use the --update-compress or --inactive options to fetch > prices during times where you're not holding a given commodity. > > Edge cases & current drawbacks (much of the logic is in the > 'get_price_jobs_up_to_date' method in find_prices.py): > - For a given commodity, the update looks for the latest price date to > start updating from, it doesn't try to do any advance 'filling' across > multiple gaps of missing prices, though that doesn't seem like a typical > usecase. > - If you use --inactive with a commodity that has never been held, it > will currently try to fetch prices from the commodity directive's date. > Open to feedback as to whether this should be done or not. > - I'm not sure how to handle commodities that don't have a price source > listed - right now those will just throw up error messages. Perhaps an > --ignore-undeclared-source option? > > > So far the testing has just been through unit tests & my personal ledger > file, so would love to hear if anyone else tries this out. I don't seem > have pullrequest access so perhaps Martin can merge it in if it seems > suitable. > > -Vivek > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/b2498c0e-d7ea-4857-b7e9-0b9ae6acf4cb%40googlegroups.com.
