Refactor ledger processing to explicit mapping which will make automated classfication easy

This commit is contained in:
2023-06-24 22:54:31 +02:00
parent b6de0e5514
commit ba0c906e3c
9 changed files with 421 additions and 8 deletions

View File

@@ -1,6 +1,9 @@
# defaultpy
# ledgerai
Default Python project.
Script to transform CSV data into [ledger](https://ledger-cli.org/) accounting
files.
# Usage
Run `pipenv install -dev` to install all packages.
@@ -8,3 +11,20 @@ Run `pipenv shell` to get venv shell.
Run `pipenv install <package>` to install a package.
# 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.
For now, ledger files are simply 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 filename, line number) to the
respective *account2*, and (optinally) *tags* or *description.