← The Catalogue python engine
No. 04

Financial statements that rebuild themselves from the trial balance

A three-layer engine that turns a trial balance into Schedule III / IND AS statements where every figure cascades from one source of truth.

IND ASSchedule III Div IIPython (openpyxl)Excelconfig-driven design
How it works — the logic, animatedpython engine

Context

Annual financial statements meant managing well over a thousand individual figures — roughly 1,500 — spread across multiple statements and notes, where one number changing had to flow correctly into every place it appeared, and where the wording of accounting policies needed to version independently from the figures. Done by hand in linked spreadsheets, this is slow, fragile, and a perennial source of last-minute errors.

Challenge

Get reliable version control over ~1,500 figures so a single trial-balance change cascades everywhere automatically, the statements stay internally consistent, and text and numbers can each be edited without breaking the other.

What I built

A three-layer engine:

  • Data layer — the source trial balance and supporting schedules.
  • Dictionary layer — a flat, keyed register where every named figure lives once, tagged by type (amount vs. non-amount items like share counts and EPS, which must never be unit-converted).
  • Template / output layer — formatted, print-ready statements that pull every value from the dictionary by key.

A single config file controls reporting unit (millions or crores), decimal places, period labels and signatories — change it once and the whole pack re-renders. The build also cleans up the messy realities of real data: floating-point note numbers, duplicate sub-labels across current vs. non-current sections, and the like. Two commands regenerate the dictionary and rebuild the entire statement pack.

Outcome

A statement pack that rebuilds itself from the trial balance, with figures that cascade reliably and notes that version on their own track. The annual-accounts grind turned from manual cross-checking into a deterministic, two-command refresh — repeatable for every period and extensible to consolidated reporting.

© Deepak Sharma — Finance Transformation ca.deepaksharma1@gmail.com Back to the catalogue →