Skip to content

wini83/citi2firefly_iii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏦 Citi Handlowy Bank → Firefly III CSV Converter (CLI Edition)

Python application Pylint CodeQL Advanced

This Python CLI tool converts raw text exports from bank statements into .csv files compatible with Firefly III.

🔧 Features

  • 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

🚀 CLI Usage

python main.py --input sample_data/example_input.txt --output transactions --chunk-size 60

🔁 Parameters

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)

📄 Example Input

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

📤 Output Format

Each .csv file contains the following columns:

Date;Amount;Payee;Description;Category;Source account;Destination account;Tags;Notes

Example:

2025-05-19;-7.50;ZABKA POZNAN;ZABKA POZNAN;;;Bank;ZABKA POZNAN;;

📁 Project Structure

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

🧪 Running Tests

pip install -r requirements.txt
pytest

Tests are implemented with click.testing.CliRunner to validate end-to-end usage.

📦 Installation

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.txt

Requires Python 3.7+

📄 License

MIT License

About

CSV converter for Citi Handlowy exports – built for Firefly III users.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages