Can bean-price import multiple days at one

82 views
Skip to first unread message

Peter

unread,
Nov 18, 2023, 11:05:23 AM11/18/23
to Beancount
Hi,

I'm trying to create a custom bean-price importer. I'm scraping prices from a paginated set of prices. I can retrieve 20 prices at once.

I noticed that 

bean-price -v -i --no-cache --update test.bean

will call beanprice.source.Source.get_historical_price() for every day between 2023-11-18 and 2023-11-01 if test.bean contains this commodity definition:

2023-11-01 commodity A12CX1
name: "Vanguard FTSE Developed World (Dist)"
price: "EUR:myimporter/IE00BKX55T58"


While this seems to work it is not really efficient. I could retrieve this period at once using one single request. Bean-price makes 18 individual requests. (Additionally, a running into a rate limit is very likely for larger time periods).

beanprice.source.Source has a method called get_prices_series. How can I leverage that?
Reply all
Reply to author
Forward
0 new messages