Price quotes fetcher for Beancount
Project description
beanprice: Price quotes fetcher for Beancount
Description
A script to fetch market data prices from various sources on the internet and render them for plain text accounting price syntax (and Beancount).
This used to be located within Beancount itself (at v2) under beancount.prices. This repo will contain all future updates to that script and to those price sources.
Documentation
Some documentation is still part of Beancount. More about how to use this can be found on that mailing-list. Otherwise read the source.
Quick start
To install beanprice, run:
pip install git+https://github.com/beancount/beanprice.git
You can fetch the latest price of a stock by running:
bean-price -e 'USD:yahoo/AAPL'
To fetch the latest prices from your beancount file, first ensure that commodities have price metadata, e.g.
2000-01-01 commodity AAPL
price: "USD:yahoo/AAPL"
Then run:
bean-price ledger.beancount
To update prices up to the present day, run:
bean-price --update ledger.beancount
For more detailed guide for price fetching, read https://beancount.github.io/docs/fetching_prices_in_beancount.html.
Price source info
The following price sources are available:
Name | Module | Provides prices for | Base currency | Latest price? | Historical price? |
---|---|---|---|---|---|
Alphavantage | beanprice.alphavantage |
Stocks, FX, Crypto | Many currencies | ✓ | ✕ |
Coinbase | beanprice.coinbase |
Most common (crypto)currencies | Many currencies | ✓ | ✓ |
Coincap | beanprice.coincap |
Most common (crypto)currencies | USD | ✓ | ✓ |
Coinmarketcap | beanprice.coinmarketcap |
Most common (crypto)currencies | Many Currencies | ✓ | ✕ |
IEX | beanprice.iex |
Trading symbols | USD | ✓ | 🚧 (Not yet!) |
OANDA | beanprice.oanda |
Many currencies | Many currencies | ✓ | ✓ |
Quandl | beanprice.quandl |
Various datasets | Various datasets | ✓ | ✓ |
Rates API | beanprice.ratesapi |
Many currencies | Many currencies | ✓ | ✓ |
Thrift Savings Plan | beanprice.tsp |
TSP Funds | USD | ✓ | ✓ |
Yahoo | beanprice.yahoo |
Many currencies | Many currencies | ✓ | ✓ |
Testing
Run tests:
pytest beanprice
Lint:
pylint beanprice
Type checker:
mypy beanprice --ignore-missing-imports
Copyright and License
Copyright (C) 2007-2020 Martin Blais. All Rights Reserved.
This code is distributed under the terms of the "GNU GPLv2 only". See COPYING file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file beanprice-1.2.1.tar.gz
.
File metadata
- Download URL: beanprice-1.2.1.tar.gz
- Upload date:
- Size: 58.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3f5b5ab6e73eb136385bee6645a49519e9354d340d412b7e3580ec65a4e1957 |
|
MD5 | d2836283307f3038522f21601c57db95 |
|
BLAKE2b-256 | dad0dc4ea43b0b559091d36cd9779b912fa28d909ba279e7f4f809057e54b9b8 |
File details
Details for the file beanprice-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: beanprice-1.2.1-py3-none-any.whl
- Upload date:
- Size: 69.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b18fb8baa5913d9150ffe8d9d9dacefca1571d2644fd2b3b1240368fe5f395b8 |
|
MD5 | 4a31d0b574dd3295d61432f95ca6447c |
|
BLAKE2b-256 | 2c614524b3f18c86d6a3866cf9290a4d9fb9e5428fa55382c893f6fd8279f3e6 |