Desktop, CLI and Web application to track fuel refuels, compute spending KPIs and export PDF reports. Now using src/ layout with SQLite + JSON persistence and Docker support.
| Feature | Description |
|---|---|
| Refuel logging | Date, liters, amount paid, price per liter, station, odometer |
| KPI dashboard | Total spent, total liters, average price, monthly average |
| Monthly chart | Interactive bar chart via matplotlib |
| PDF export | Full report with table via ReportLab |
| Persistence | JSON file or SQLite (configurable via DATA_DIR env) |
| GUI + CLI + Web | ttkbootstrap GUI, terminal CLI, Flask web UI |
docker compose up -d
# Open http://localhost:5000Data persists in ./data/ (SQLite, gitignored).
- Python 3.10+
pip
git clone https://github.com/FrancescoCastaldi/BenzaTracker.git
cd BenzaTracker
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtgit clone https://github.com/FrancescoCastaldi/BenzaTracker.git
cd BenzaTracker
install_and_run.batDATA_DIR=./data python -m benzatracker.web
# → http://localhost:5000python -m benzatracker.guipython -m benzatracker.cliOr use the unified entry point:
python -m benzatracker # runs CLI by default
python -m benzatracker --gui # runs GUI
BENZA_WEB=1 python -m benzatracker # runs Web (Flask)For a complete reference — including editable install, entry-point shortcuts, Docker, environment variables, data persistence modes, and troubleshooting — see LAUNCH_GUIDE.md.
New contributors should read CONTRIBUTING.md. All participants must follow our Code of Conduct.
pip install pytest pytest-cov
pytest -v --tb=shortTests cover JSON store, SQLite store, KPI computation, CLI windows, and Flask routes.
BenzaTracker/
├── .editorconfig # Editor-agnostic settings
├── .gitattributes # Git attributes
├── .gitignore
├── .pre-commit-config.yaml # Pre-commit hooks (ruff, mypy)
├── CODE_OF_CONDUCT.md # Contributor Covenant 2.1
├── CONTRIBUTING.md # Full contributing guide
├── SECURITY.md # Vulnerability reporting policy
├── SUPPORT.md # Where to get help
├── LAUNCH_GUIDE.md # Detailed launch instructions
├── Dockerfile
├── docker-compose.yml
├── pyproject.toml # Build config + ruff/mypy/pytest + entry points
├── requirements.txt
├── install_and_run.bat
├── .github/
│ ├── workflows/
│ │ └── python-app.yml # CI pipeline (3.10–3.12)
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── feature_request.yml
│ │ └── config.yml
│ └── PULL_REQUEST_TEMPLATE.md
├── src/
│ └── benzatracker/
│ ├── __init__.py
│ ├── __main__.py # Entry point (CLI / GUI / Web dispatch)
│ ├── config.py # Environment variables, paths
│ ├── models.py # RefuelEntry, KPIReport dataclasses
│ ├── store.py # Store protocol + create_store() factory
│ ├── json_store.py # JSON persistence (atomic write)
│ ├── sqlite_store.py # SQLite persistence
│ ├── kpi.py # KPI computation
│ ├── cli.py # Command-line interface
│ ├── gui.py # ttkbootstrap graphical interface
│ ├── web.py # Flask web application
│ ├── pdf.py # PDF export via ReportLab
│ └── templates/ # Jinja2 HTML templates
│ ├── base.html
│ ├── index.html
│ └── entries.html
├── tests/
│ ├── test_data_store.py # JsonStore tests
│ ├── test_kpi.py # KPI computation tests
│ ├── test_cli_windows.py # CLI window tests
│ └── test_database.py # SqliteStore tests
└── data/ # SQLite database (Docker volume, gitignored)
See CONTRIBUTING.md for the full guide (setup, coding style, testing, PR workflow).
Quick links:
See CHANGELOG.md for the full version history.
Distributed under the MIT license. See LICENSE for details.