This Python CLI tool converts raw text exports from bank statements into .csv files compatible with Firefly III.
- Parses raw statement data (copied from website)
- Converts Polish dates (e.g.
"19 maj 2025") to ISO format ("2025-05-19") - Filters out positive (credit) transactions by default
- Optionally splits output into chunks (e.g. max 60 transactions per file)
- Fully CLI-based using
click - Easily testable using
pytest
python main.py --input sample_data/example_input.txt --output transactions --chunk-size 60| Flag | Description |
|---|---|
--input, -i |
Path to the input .txt file (required) |
--output, -o |
Output base filename (default: output) |
--chunk-size |
Number of transactions per file (default: 60) |
--include-positive |
Include positive amounts (disabled by default) |
19 maj 2028
ZABKA Z9999 K.2 POZNAN PL
ZABKA Z9999 K.2 POZNAN PL
-7,50PLN
16 sty 2020
Seabank Hotel Mellieha MT
Seabank Hotel Mellieha MT
-22,84PLN
5,00EUR
Each .csv file contains the following columns:
Date;Amount;Payee;Description;Category;Source account;Destination account;Tags;NotesExample:
2025-05-19;-7.50;ZABKA POZNAN;ZABKA POZNAN;;;Bank;ZABKA POZNAN;;bank_parser_project/
├── main.py
├── parser/
│ ├── __init__.py
│ ├── date_utils.py
│ ├── transaction_extractor.py
│ └── csv_exporter.py
├── tests/
│ ├── __init__.py
│ └── test_cli.py
├── sample_data/
│ └── example_input.txt
└── requirements.txt
pip install -r requirements.txt
pytestTests are implemented with click.testing.CliRunner to validate end-to-end usage.
No installation required. Just clone and run:
git clone https://github.com/YOUR_USERNAME/citi2firefly_iii.git
cd citi2firefly_iii
python main.py --input your_file.txtRequires Python 3.7+
MIT License