Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FinanceReport Auto

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)


Features

  • 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 exportsPDF (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.

A note on the PDF engine

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.


Quick start

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 7575

Open http://localhost:7575.

Re-seed at any time with python manage.py seed_demo --flush.


How it fits together

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

Data model notes

  • Money is stored as Decimal; amount_base holds 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.

Configuration

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


Tests / verification

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.

License

Apache License 2.0 — see LICENSE.

About

Automatic company financial report generator — income statements, expense breakdown, cash flow, balance sheet and tax with branded PDF/Excel export. Django + pandas + ReportLab + openpyxl, multi-period and multi-currency.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages