Files
ledgerai/README.md

37 lines
1.2 KiB
Markdown

# ledgerai
Script to transform CSV files into [beancount](https://beancount.github.io/docs/beancount_language_syntax.html) accounting files.
## Usage
To transform CSV data into Beancount run `toldg` via `python-poetry`.
```bash
poetry -P ${LEDGER_DATA_ROOT} run toldg
```
To visualize the data with [fava](https://beancount.github.io/fava/) install all
dependencies via `python-poetry`, enable the venv and run `fava` from there.
```bash
poetry install
eval "$(poetry env activate)"
fava your_ledger.beancount
```
## Architecture
The script takes a directory in which it recursively searches for CSV and LDG
files. From these files, it generates a single ledger accounting file that
includes all transactions.
Ledger files are appended to the output file without modifications.
However, the transaction for the CSV files are extended with their *account2*
information, i.e, the category of the transaction. Optionally, these
transactions can also get a more meaningful description and tags.
The mapping information are stored in a file `mappings.json`. It maps a unique
identifier for each transaction (based on the filename and full CSV row) to a
respective *account2*.