Ekow24's picture
Update README.md
70d788a verified

A newer version of the Streamlit SDK is available: 1.56.0

Upgrade
metadata
title: My Streamlit App
emoji: 🚀
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: 1.39.0
app_file: app.py
pinned: false

AI Spending Analyser (Streamlit)

Features

  • Synthetic dataset (~900 rows) across ~1 year with realistic variability
  • Filters: date range, categories, merchant query
  • Metrics: total, average monthly, max/min transaction
  • Charts: daily trend (line), spend by category (bar), payment methods (donut)
  • AI summary: OpenAI GPT if OPENAI_API_KEY exists, else deterministic heuristic summary
  • CSV download of filtered data

Quickstart

  1. Install python -m venv .venv . .venv/Scripts/activate # Windows PowerShell pip install -r ai_spending_analyser/requirements.txt

  2. Run locally streamlit run ai_spending_analyser/app.py

  3. (Optional) Enable OpenAI summaries

PowerShell

$env:OPENAI_API_KEY = "sk-..."

Deploy to Streamlit Cloud

  1. Push this folder to a GitHub repo.
  2. On Streamlit Cloud, create a new app pointing to ai_spending_analyser/app.py.
  3. Add OPENAI_API_KEY as a secret if you want AI summaries.

Libraries

  • streamlit
  • pandas
  • numpy
  • plotly
  • openai (optional)
  • ollama (optional; for free local LLM)

Local LLM (Ollama)

  1. Install Ollama: https://ollama.com
  2. Run Ollama and pull a small model, e.g.: ollama pull llama3.2
  3. In the app sidebar, set Engine to "Ollama" and (optionally) model to "llama3.2".
  4. No API keys needed; runs fully offline.

Notes

  • The app gracefully handles empty filters by showing an info message.
  • Regenerate button synthesizes a fresh dataset.