A small Python tool to analyze fuel usage from a CSV, generate charts, and export a PDF report.
data.csv— your data input (seedata.example.csvfor schema)fuelAnalysis.ipynb— original exploratory notebooksrc/fuel_tracking/— reusable Python packageio.py— load and prepare datastats.py— compute aggregations and statsviz.py— create charts intooutputs/report.py— assemble a PDF report with charts and statscli.py— command-line interface
outputs/— generated charts and reportspyproject.toml— project metadata and dependencies
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .Run against the default data.csv and write to outputs/:
fueltrackSpecify a CSV and output directory:
fueltrack path/to/data.csv --out resultsRequired columns (see data.example.csv):
Date(parseable by pandas)Distance(km)PetrolFilled(Litres)(L)TotalCost($)- Optional:
PetrolType
- The CLI mirrors the notebook’s calculations and plots. If you add new analyses in the notebook, consider moving them into
src/fuel_tracking/and invoking them from the CLI. - Generated assets are written under
outputs/by default.