Spaces:
Sleeping
Sleeping
A newer version of the Streamlit SDK is available: 1.56.0
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
Install python -m venv .venv . .venv/Scripts/activate # Windows PowerShell pip install -r ai_spending_analyser/requirements.txt
Run locally streamlit run ai_spending_analyser/app.py
(Optional) Enable OpenAI summaries
PowerShell
$env:OPENAI_API_KEY = "sk-..."
Deploy to Streamlit Cloud
- Push this folder to a GitHub repo.
- On Streamlit Cloud, create a new app pointing to ai_spending_analyser/app.py.
- 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)
- Install Ollama: https://ollama.com
- Run Ollama and pull a small model, e.g.: ollama pull llama3.2
- In the app sidebar, set Engine to "Ollama" and (optionally) model to "llama3.2".
- 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.