Importers for various institutions for Beancount
Project description
beancount_reds_importers
Simple importers and tools for beancount.
For a comprehensive look at writing importers, see The Five Minute Ledger Update.
Importers can be ugly and painful to write, yet are important in automating the grunt work out of maintaining personal finance software. The philosophy is to make writing importers easy. To achieve this, the design goal is to separate importers in to three parts:
- file format reader (reusable)
- transaction builder (reusable)
- institution-specific declarations and code (minimal, institution specific)
This helps move common code into (1) and (2) above, and makes writing new importers easy by sipmly picking from one of those two along with with minimal declarations and code in (3).
File format readers included are:
- ofx
- csv (single and multitable support)
- xlsx (single and multitable support)
Transaction builders included are:
- banking (for banks and credit cards, which benefit from a postings predictor like smart_importer
- investments/brokerages (to handle the very many distinct cases of investment related transactions)
- paychecks (to handle paychecks, which typically contain very many pre-determined postings in a single entry)
Input in ofx format (over csv) minimizes data and coding errors, eliminates format breaking changes in csv, and typically includes balances that are used to generate balance assertions, and commodity prices.
Look inside the importers/ directory to see a list of institutions supported. More investment, credit card, and banking institutions will be added in the future. Contributions welcome.
Installation
pip3 install beancount-reds-importers
Or to install the bleeding edge version from git:
pip3 install git+https://github.com/redstreet/beancount_reds_importers
If you plan on importing excel files, also run:
pip3 install openpyxl
Running the included examples:
cd <your pip installed dir>/example #eg: cd ~/.local/lib/python3.8/site-packages/beancount_reds_importers/example
./import.sh OfxDownload.qfx
# Imports investments./import.sh transactions.qfx
# Importa bank transactions; uses smart_importer to classify transactions
Running
- Create your own my.import. An example my.import is provided. At the least, include your account numbers
- Include fund information. Copy the included
fund_info.py
to start with. - You can now run
bean-identify
,bean-extract
, etc. See the included script: Run./import.sh <your_input_ofx>
- If cusip info is missing, the importer will let you know. Add it to your
fund_info.py
Testing
I run tests across hundreds of actual ofx and csv files, against reference outputs that I know to be correct from my personal file. However, I'm unable to share them since these are personal. Testing against real world files is best, so I recommend you do this with your own input files. Having said that, Unit tests are probably useful, even if limited, and I'll add these shortly (contributions welcome).
Contributions
Test ofx files and test infra appreciated.
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
Hashes for beancount_reds_importers-0.4.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d895d561769478d58a69464af8c14c9bc972acce258b04a9d21386f6e6a5e8c |
|
MD5 | de9bbb246b9fa689036918f859ab8f18 |
|
BLAKE2b-256 | 76a5a7bdc814b992cf46fc165f251de7d4c2f851e1a1340df0e4b8abbc8c6bba |
Hashes for beancount_reds_importers-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fb44c54e10b1fef5548e71f35586a9e28b2d67d2d11ebd83f946ecf0cfffade |
|
MD5 | 8382e9ed1e89d89b25ab2a2147e05321 |
|
BLAKE2b-256 | a92f88925c8cb191f9489fc0765c37e96f58008dd88348eca5266946b4f15a4b |