Skip to content

02 — The demo CSV

Duration: 10 min Prerequisites: a text editor or VS Code.

The repo ships with a ready-to-use CSV at:

csv-llm-ollama/
└── data/
└── data1-anonymized.csv ← 734 synthetic transactions

You can open it in any editor. It’s a plain ;-separated file with quoted strings.

Header (first line):

"Date";"Card Number";"Description";"Category";"Debit";"Credit"

A few rows:

"2027-12-27";"************4382";"Late Payment Fee";"Fees";"24.31";"0"
"2027-12-26";"************4382";"Postbox Rental";"Housing";"489.53";"0"
"2027-12-25";"************4382";"City Cab Network";"Transport";"73.34";"0"
"2027-12-24";"************4382";"Travel Booking Refund";"Refunds";"0";"69.15"
"2027-12-24";"************4382";"Harbor Noodle House";"Dining";"59.22";"0"
"2027-12-23";"************4382";"Credit Card Payment Thank You";"Payments";"0";"850.65"

Six columns:

ColumnTypeNotes
DateYYYY-MM-DDAll transactions in 2027
Card NumbermaskedAlways ************4382
DescriptionstringThe merchant name
CategorystringOne of 13 English categories
Debitstring numberMoney out; "0" if not applicable
Creditstring numberMoney in (refunds, card payments)
MetricValue
Rows (excl. header)734
Expense rows (Debit > 0)675
Credit rows (Credit > 0)59
Total debit$118,667.69
Total credit$43,707.67
Date range2027-01-022027-12-27
Distinct months12
CategoryExample merchants
BusinessDesignMarket License, PrintWorks Studio, Invoice Client Deposit
DiningHarbor Noodle House, Coastal Spoon Cafe, Maple Table Bistro
EducationOnline course bundles, certification fees
EntertainmentPuzzleRoom Adventure, Riverfront Music Hall, GameCorner Store
FeesLate Payment Fee, foreign exchange fees
GroceriesWellington Pantry Co, Canterbury Family Foods, Rotorua Organic Store
HealthCarePlus Lab Services, ActiveLife Physiotherapy
HousingRent Payment Willow Street, Postbox Rental, StorageBox Monthly
PaymentsCredit Card Payment Thank You (statement-level entries)
RefundsTravel Booking Refund and other returns
TransportCity Cab Network, NorthLine Bus Card, GreenRide Shuttle
TravelQueenstown Path Pass, Aotearoa Lodge Booking, Pacific Coast Hostel
UtilitiesClearNet Fibre, Harbor Internet Co

A quick pandas look (you’ll do this in chapter 07):

import pandas as pd
df = pd.read_csv("data/data1-anonymized.csv", sep=";", quotechar='"')
df["Debit"] = pd.to_numeric(df["Debit"], errors="coerce").fillna(0)
print(df.groupby("Category")["Debit"].sum().sort_values(ascending=False).head(5))

Expected output:

Category
Housing 30895.29
Travel 16597.44
Business 14386.39
Groceries 9725.93
Education 8987.85
Name: Debit, dtype: float64

These will show up in the Chat demos in chapter 09:

MerchantVisitsTotal spent
Coastal Spoon Cafe19$1,221.34
Harbor Noodle House18$1,095.60
NorthLine Bus Card18$795.76
Rent Payment Willow Street8$6,761.44
Queenstown Path Pass8$4,315.40

We’ll use Coastal Spoon Cafe as the recurring merchant for canonical question Q3.

A simple read (we’ll do better in chapter 04 with csv-llm-shared/ingest.py):

from pathlib import Path
import csv
path = Path("csv-llm-ollama/data/data1-anonymized.csv")
with path.open(encoding="utf-8-sig") as f:
reader = csv.DictReader(f, delimiter=";", quotechar='"')
rows = list(reader)
print(len(rows)) # 734
print(rows[0])
# {'Date': '2027-12-27', 'Card Number': '************4382', ...}
  • The repo ships with csv-llm-ollama/data/data1-anonymized.csv — 734 synthetic transactions.
  • 6 columns, ; separator, UTF-8 BOM tolerant.
  • 12 months of 2027, 13 English categories, 1 masked card.
  • Top category is Housing ($30,895.29). Most-frequent merchant is Coastal Spoon Cafe (19 visits).

Next: Setting up the environment →