bean-price

57 views
Skip to first unread message

francois PEGORY

unread,
May 6, 2020, 5:56:48 PM5/6/20
to Beancount
hello,
i try to use bean-price (especially to fetch price of european stocks) and i don't succeed.
sorry to ask about it but where is the most recent documentation about it ?



Aamer Abbas

unread,
May 6, 2020, 6:48:14 PM5/6/20
to Beancount
Check out https://aumayr.github.io/beancount-docs-static/api_reference/beancount.prices.html

You need to use the "-e" command line parameter to pass in the string, including the source. For example if you want to get the price for Amazon stock from Yahoo: bean-price -e "USD:yahoo/AMZN"

You can also define this string as part of your commodity. Then you can just run bean-price on your main file and it will automatically pull the prices for all commodities that you currently hold. Again, with the Amazon example, the commodity could be defined like this:
1997-05-15 commodity AMZN
  name: "Common shares of Amazon"
  price: "USD:yahoo/AMZN"


Yahoo already comes built-in as a source. I think some others do too, but I can't remember which ones (I think Google, maybe some others - check the source code or docs). If you need additional sources, you can write your own too. Here's a hacky example I wrote (and use myself) to get prices for cryptocurrencies from coinmarketcap.comhttps://github.com/aamerabbas/beancount-coinmarketcap


--
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 beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CALUWbLd4r7Y_N60G5jdwjtppeOb_K8EPuFv%3DOuMXSdp%3DKj%2BzAw%40mail.gmail.com.

francois PEGORY

unread,
May 7, 2020, 9:02:50 AM5/7/20
to Beancount
thanks a lot for the information.
i succeed to make it even work a price source for french fund to get the current price.

you could find it there :




Reply all
Reply to author
Forward
0 new messages