Skip to content

Project 1 — Card-spending analysis with Ollama (local)

Audience: students who finished Course 2 (or already know how to install Python + Ollama) and want to build a complete, fully local project: data ingestion, SQL store, dashboards and a tool-using LLM agent.

Level · IntermediateDuration · ~3 hoursChapters · 9Stack · Streamlit + Python + SQLite + Ollama + Plotly

We start from a mundane file — a credit-card CSV export — and build, step by step, a real app that does three things:

  1. Understands the CSV: columns, date formats, debit/credit.
  2. Renders useful dashboards: total, monthly, top merchants, category split.
  3. Answers questions in plain English: “How much did I spend on groceries last month?”, by letting an LLM write SQL and run it against a local SQLite database.

Everything runs on your machine. No API key, no cloud, your data never leaves.

  • A Streamlit app on http://127.0.0.1:8504 that:

    • loads csv-llm-ollama/data/data1-anonymized.csv (734 transactions);
    • shows 4 dashboards (monthly, by category, top 10, recurring merchants);
    • lets you chat with your spending:

      you: What is my biggest spending category?

      model: Your biggest spending category is “Housing” with $30,895.29.

      (SQL: SELECT category, SUM(amount) FROM transactions WHERE amount > 0 GROUP BY category ORDER BY SUM(amount) DESC LIMIT 1)

  • A reusable shared Python module csv-llm-shared/ (ingest, normalize, db, categorize, dashboards) — deep-dived in Project 3.

#ChapterDurationType
01Overview and goals8 minTheory
02The demo CSV10 minHands-on
03Setting up the environment15 minHands-on
04CSV ingestion across banks15 minCode
05Normalization and SQLite15 minCode
06Categorization: rules and LLM12 minCode
07Plotly dashboards15 minCode
08LLM agent with SQL tool25 minCode
09Running the app step-by-step15 minGuided
  • Linear (recommended): 01 → 09. About 3 hours.
  • Express, just run the app: 02 → 03 → 09. 30 min.
  • Theory only (no install): 01 → 04 → 06 → 08.

Want the cloud variant (OpenAI, faster, paid) once you finish? Head to Project 2 — csv-llm-openai. Want to deep-dive into the shared Python library? Head to Project 3 — csv-llm-shared.

Start with chapter 01 →