Verify your first bank statement
Run a two-row bank CSV in the browser or locally, resolve a missing opening balance, and trace a released result back to its source.
In this tutorial you’ll process a synthetic bank statement twice, resolve a missing opening balance, and use the released JSON to verify both transactions. The browser walkthrough requires no installation. For the local walkthrough, use Python 3.11 or newer and Node.js 20 or newer if you choose Node.js.
1. Read the sample
The sample is a CSV, a plain-text file with comma-separated columns. The Balance column is the amount left in the account after each transaction.
| Date (day/month/year) | Movement | Amount (INR) | Balance after (INR) |
|---|---|---|---|
| 02/01/2026 | Debit | 100.00 | 900.00 |
| 03/01/2026 | Credit | 50.00 | 950.00 |
The sample omits its opening balance, the amount before the first row. For this exercise, the known opening balance is INR 1000.00. For a real statement, get this value from the original statement or another authoritative source, such as the verified closing balance of the preceding statement for the same account.
2. Run in the browser
- Choose Run without opening. The engine returns
status: "refused"anderror.code: "PARSE_ERROR". Look for the message asking for an opening balance. - Choose Run with opening. This sends the same CSV with
--opening 1000.00. The engine now returnsstatus: "ok". - Scroll through the JSON output and find
data.transactions,assertions, andevidence.
Sample terminal
Commands run the bundled CSV through the live engine. Type help for the supported commands.
Run the sample as-is, then supply the opening balance.
3. Repeat locally
Download statement.csv into your project and open a terminal in that directory. Set up your environment using the installation guide if you haven't installed Open Books before. The commands pass INR as the currency and dmy as the date order, so 02/01/2026 becomes 2026-01-02.
python -m pip install "openbooks==0.2.0"
python -m openbooks run statement.csv --currency INR --date-order dmy --out refused
python -m openbooks run statement.csv --currency INR --date-order dmy --opening 1000.00 --out releasedThe first run exits 1 and writes a refusal under refused/. Run the two commands individually if your shell stops on nonzero exit codes. The corrected run exits 0 and writes the release under released/. Both files have the same SHA-256 filename because the input bytes are identical. Separate directories preserve both attempts.
4. Verify the result
| Check | JSON field | Expected result |
|---|---|---|
| Release decision | status | "ok" |
| Transaction directions | data.transactions | INR 100.00 debit, then INR 50.00 credit |
| Closing balance | data.batches[0].closing.amount | "950.00" |
| Reconciliation | assertions | Opening minus debit plus credit gives 950.00. Each row's computed balance matches the CSV. |
| Source for the closing balance | evidence["batch-1.closing"] | raw_text: "950.00" at row 3, counting the CSV header as row 1 |
Next, build a Python importer that saves the full decision and computes exact totals, or work through bank statement exports with a representative file.
Open Books Developer Documentation
Turn financial files into verified JSON with Open Books. Start with a sample, then integrate through the CLI, Python, Node.js, HTTP, or MCP.
Install Open Books
Install the Open Books engine and npm wrappers, add OCR and model support, and verify engine discovery in your environment.