Skip to Content
Open Books for developers

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)MovementAmount (INR)Balance after (INR)
02/01/2026Debit100.00900.00
03/01/2026Credit50.00950.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

  1. Choose Run without opening. The engine returns status: "refused" and error.code: "PARSE_ERROR". Look for the message asking for an opening balance.
  2. Choose Run with opening. This sends the same CSV with --opening 1000.00. The engine now returns status: "ok".
  3. Scroll through the JSON output and find data.transactions, assertions, and evidence.

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 released

The 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

CheckJSON fieldExpected result
Release decisionstatus"ok"
Transaction directionsdata.transactionsINR 100.00 debit, then INR 50.00 credit
Closing balancedata.batches[0].closing.amount"950.00"
ReconciliationassertionsOpening minus debit plus credit gives 950.00. Each row's computed balance matches the CSV.
Source for the closing balanceevidence["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.

View this page as Markdown