This is a command-line tool to manipulate the Securities Database in Gnucash books. Currently it supports listing securities, and adding a new security by fetching its data by ISIN.
To run this tool, you will need the following:
- Python bindings for Gnucash,
- Poetry.
Since Gnucash is not added explicitly as a dependency on this package, you will have to enable system site packages access in Poetry:
$ poetry config virtualenvs.options.system-site-packages true
Feel free to add instructions for your operating system.
Ubuntu:
$ sudo apt-get install python3-gnucash python3-poetry gnucash
$ poetry config virtualenvs.options.system-site-packages true
$ poetry install --without=dev
Listing tickers in a book:
$ poetry run python -m tickers list book.gnucash -v
+--------------+-------------------------------------------+--------+----------------+--------------+-----------+
| Namespace | Name | Symbol | Display Symbol | ISIN | Fraction |
+--------------+-------------------------------------------+--------+----------------+--------------+-----------+
| template | template | | template | template | 1/1 |
| Currencies | Andorran Franc | | ₣ | 950 | 1/100 |
...
Adding a ticker by its ISIN:
$ poetry run python -m tickers add test.gnucash US6903701018
+-----------+----------------+--------+----------------+----------------+----------+
| Namespace | Name | Symbol | Display Symbol | ISIN | Fraction |
+-----------+----------------+--------+----------------+----------------+----------+
| NYQ | Beyond, Inc. | BYON | BYON | US6903701018 | 1/10000 |
+-----------+----------------+--------+----------------+----------------+----------+
Do you want to add this security? (yes/no) [no] y
Please install the pre-commit hooks to make sure your code passes my very high quality standards. /s
$ poetry install --with=dev
$ poetry run pre-commit install
Add unit tests for all new code.