This script can import daily stock and forex quotes from Alpha Vantage and insert them into GnuCash's database.
- Connect to any type of GnuCash data source supported by piecash (*.gnucash files, relational databases, plain XML, etc)
- It can run even without GnuCash installed
- Automatic throttling to avoid over-polling
- Ignores price if it was already downloaded that day
- Python 3
- piecash
- alpha-vantage
- python-dateutil
Just run pip install -r requirements.txt
It is recommended to install dependencies inside a dedicated virtualenv.
Edit script to set up
- Alpha Vantage API key
- Connection parameters
- Namespace - currency pairs
Run: python gnucash_quotes.pty