pricehist: a tool to fetch historical prices in leger format

26 views
Skip to first unread message

Chris Berkhout

unread,
Jun 25, 2021, 12:51:38 PMJun 25
to ledge...@googlegroups.com
Hi all,

I've written a command-line tool to fetch daily historical prices. It currently supports 5 sources of data and will generate output in 4 formats, including ledger/hledger.


If this might be useful for you please try it and let me know what you think. I'm still improving error handling and some other things but the main functionality is done.

Cheers,
Chris

Daniele Nicolodi

unread,
Jun 25, 2021, 5:32:28 PMJun 25
to ledge...@googlegroups.com
How does this tool differ from bean-price?

Cheers,
Dan

Chris Berkhout

unread,
Jun 26, 2021, 2:41:55 AMJun 26
to ledge...@googlegroups.com
How does this tool differ from bean-price?

They can both fetch daily prices but bean-price is more Beancount-specific and pricehist has some more flexibility.

With bean-price you can ask for a price on a day from the command line. However, to get prices for a time range you need to give it a Beancount file with a commodity directive at the start date. You can invert prices, which will be rounded automatically. The output format is beancount price directives.

With pricehist everything is specified on the command line. You can ask for data for a time interval with a particular start and end. You can control rounding (--quantize) and invert prices. The output format can be CSV, Beancount, Ledger or SQL for GnuCash. There are options for formatting or rewriting parts of the output so you usually won't need to manually reformat things.

Cheers,
Chris
Reply all
Reply to author
Forward
0 new messages