This tool pulls the trial balance from Xero's own reporting API and refuses to write the CSV unless both the month's movement and the year to date figures balance. It asks Xero for report reading scope only, so it cannot write anything back to a ledger.
The manual path, Reports, Trial Balance, Export, fix the header rows, fix the account codes, takes about ten minutes per entity per month and produces a slightly different file every time. This tool pulls the same report straight from Xero's own reporting API instead, into the same tidy shape every run.
Before anything is written to disk, it runs a balance check: both the
current month's movement and the year to date figures must balance, or
no file is written at all. Note the real limit: --date is an
as-at date, not a range, because Xero's Trial Balance endpoint only
accepts a date, so Trial Balance by Date Range, a report that exists in
the Xero interface only, cannot be reproduced this way. The movement
columns already cover the usual reason someone reaches for a range: the
current month.
It is read-only. The scope it asks Xero for is report reading only, so it cannot write anything back to your ledger.
Read-only (accounting.reports.trialbalance.read); this tool cannot write to any ledger.
MIT-licensed utility code, no warranty; outputs feed professional review like any other workpaper input. Not affiliated with or endorsed by Xero.
python -m pip install --require-hashes -r requirements.lock
No. Xero's Trial Balance endpoint accepts an as-at date, not a range, so the Trial Balance by Date Range report, which exists in the Xero interface only, cannot be reproduced this way. The movement columns cover the usual reason for wanting a range, which is the current month.
No. It requests the accounting.reports.trialbalance.read scope, which is read-only, so it cannot write to any ledger.
No file is written. The balance check runs before anything reaches disk, and both the month's movement and the year to date figures have to balance for the export to proceed.