Automatic company financial report generator. Drop in a spreadsheet, let the smart categorizer sort it, and produce polished income statements, expense breakdowns, cash-flow statements, balance sheets and tax calculations — then export a branded PDF or Excel report for any month, quarter or year.
Built with Django + pandas for the calculations, ReportLab / openpyxl for the documents, and a server-rendered "Sterling" annual-report interface (ivory paper, pine green, brass gold; light + warm-espresso dark).
Stack: Python · Django 5 · pandas · ReportLab (PDF) · openpyxl (Excel) · SQLite Port:
7575· Theme: Sterling (light + dark)
- Auto report generator — income (sales / service / investment / interest), expenses (payroll / COGS / marketing / rent / …), net profit, cash flow and a balanced balance sheet, computed with pandas.
- Multi-period — switch any view between monthly / quarterly / yearly from the top bar; the report rebuilds instantly.
- Smart categorization — a transparent, offline keyword engine maps each transaction to a kind, category and cash-flow section. Rules live in the DB and are editable; no external AI calls required.
- Spreadsheet import — upload
.xlsx/.csv; columns are loosely mapped (date, amount, description, kind, category, currency, counterparty), the kind is inferred from a type column or the amount sign, and missing categories are auto-filled. - Tax calculator — flat or progressive brackets plus a VAT estimate; folded into every report and available as a standalone calculator.
- Multi-currency — transactions in any currency convert to the base currency via editable rates.
- Branded exports — PDF (ReportLab) and Excel (openpyxl) with the company logo and an authorised signature block.
- Resizable transaction table, filters, manual entry and a paginated ledger.
- In-app log monitor with live tail and level filtering.
- Light / dark theme and a top-bar Compact toggle that folds the sidebar to an icon rail.
The brief named PDFKit. In Python, the pdfkit package wraps the external
wkhtmltopdf binary — a real deployment barrier, especially on Windows. This
project uses ReportLab instead: pure-Python, zero system dependencies, and
purpose-built for the precise tabular layout financial statements need (with
embedded logo and signature). Excel is produced with openpyxl.
python -m venv .venv
.venv\Scripts\activate # Windows (source .venv/bin/activate on *nix)
pip install -r requirements.txt
python manage.py migrate
python manage.py seed_demo # demo company + ~18 months of multi-currency data
python manage.py runserver 7575Open http://localhost:7575.
Re-seed at any time with python manage.py seed_demo --flush.
financereport/ # Django project (settings, urls)
reports/
├── models.py # Company, Transaction, BalanceItem, CurrencyRate,
│ # CategoryRule, TaxProfile, ReportRun, AppLog
├── views.py # dashboard, transactions, import, reports, tax, settings, logs
├── forms.py # upload, manual entry, company/branding
├── services/
│ ├── ingest.py # pandas spreadsheet → transactions
│ ├── categorize.py # keyword categorization engine
│ ├── finance.py # pandas roll-ups: statements, cash flow, balance sheet, trend
│ ├── tax.py # flat / progressive tax + VAT
│ ├── currency.py # multi-currency conversion
│ ├── period.py # monthly / quarterly / yearly handling
│ ├── report_pdf.py # ReportLab PDF (logo + signature)
│ ├── report_excel.py # openpyxl workbook
│ └── logger.py # AppLog writer for the monitor
├── management/commands/seed_demo.py
├── templates/reports/ # base shell + dashboard, transactions, upload, reports, tax, settings, logs
└── static/reports/ # Sterling CSS, app JS, charts JS, vendored Chart.js
- Money is stored as
Decimal;amount_baseholds the base-currency value so aggregations never re-convert. - The dashboard rolls up with pandas; the monthly trend is bucketed in Python so results are identical regardless of the database.
- Reports are computed per period and the tax step is folded in before export.
Copy .env.example to .env. With DEBUG=False, security headers (HSTS, secure
cookies, optional SSL redirect) switch on automatically. Database is SQLite under
data/ by default; the company logo and signature upload to data/media/.
The build was verified end to end: all routes return 200, the progressive tax math
checks out exactly (e.g. $300k → $53.5k), PDF and Excel generate for every period,
import auto-categorizes mixed spreadsheets, and the dashboard renders in both themes
with no console errors.
Apache License 2.0 — see LICENSE.