https://github.com/michaelbull/beancount-plugins
A collection of my custom beancount importers & price sources, written in Python
https://github.com/michaelbull/beancount-plugins
beancount importer python
Last synced: 2 months ago
JSON representation
A collection of my custom beancount importers & price sources, written in Python
- Host: GitHub
- URL: https://github.com/michaelbull/beancount-plugins
- Owner: michaelbull
- License: isc
- Created: 2017-08-08T23:39:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-08T20:21:41.000Z (over 4 years ago)
- Last Synced: 2023-09-13T12:38:26.726Z (about 2 years ago)
- Topics: beancount, importer, python
- Language: Python
- Homepage:
- Size: 39.1 KB
- Stars: 15
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# beancount-plugins
[](https://github.com/michaelbull/beancount-plugins/actions?query=workflow%3Aci)
A collection of my custom [beancount][beancount] importers & price sources, written in [Python][python] (3.7).
## payslip.Importer
Import a PDF payslip.
### Usage
Add the following to `payslip_config.py`:
```python
from importers import payslipCONFIG = [
payslip.Importer('Google', 'Savings:NatWest', 'GBP', student_loan=False)
]
```Ensure you have a payslip `.pdf` file in the `payslips` directory:
```
$ tree payslips/
payslips/
└── june.pdf
```Run `bean-extract` to extract the transaction:
```
$ bean-extract payslip_config.py payslips/
;; -*- mode: beancount -*-
**** payslips/june.pdf2017-07-31 * "Google" "Salary"
Expenses:Tax:Income 123.45 GBP
Expenses:Tax:NationalInsurance 789.10 GBP
Assets:Savings:NatWest 1122.33 GBP
Income:Salary:Google
```## Developing
Create and activate a [`venv`][venv], then install the dependencies using
[pip][pip]:```
$ python3 -m venv venv
$ source venv/bin/activate
(venv)$ pip3 install -r requirements_dev.txt
(venv)$ PYTHONPATH=. bean-extract ft_config.py prices/
```## Type Checking
[Mypy](mypy) is installed to run static type checking on the source files.
Run the following command to perform the static type analysis:
```
(venv)$ mypy --ignore-missing-imports .
```## Contributing
Bug reports and pull requests are welcome on [GitHub][github].
## License
This project is available under the terms of the ISC license. See the
[`LICENSE`](LICENSE) file for the copyright information and licensing terms.[beancount]: http://furius.ca/beancount/
[python]: https://www.python.org/
[ft-funds]: https://markets.ft.com/data/funds/uk
[venv]: https://docs.python.org/3/library/venv.html
[pip]: https://pypi.python.org/pypi/pip
[mpypy]: http://mypy-lang.org/
[pytest]: https://docs.pytest.org/en/latest/index.html
[github]: https://github.com/michaelbull/beancount-plugins