AmirhosseinHonardoust
Community-Price-Tracker
Python

A community-driven app for tracking and comparing the prices of everyday goods across cities. Built with Python, SQLite, Pandas, and Streamlit, it lets users log, visualize, and analyze item price trends, inflation, and cost-of-living differences with clear charts and full local data privacy.

Last updated Jun 20, 2026
25
Stars
0
Forks
0
Issues
0
Stars/day
Attention Score
28
Language breakdown
No language data available.
โ–ธ Files click to expand
README

Community Price Tracker

A community-driven data app for logging and analyzing the prices of everyday goods (milk, bread, eggs, fuel, etc.) over time. This project empowers local communities to track inflation, compare cities, and visualize cost-of-living trends using a fully local, privacy-friendly setup, built with Python, SQLite, Pandas, and Streamlit.


Features

Log and manage:

  • Items, Stores, and Prices
  • Price, date, currency, and quantity
  • Multiple cities and stores
Analyze and visualize:
  • Price trend charts for any item
  • Basket cost comparison across cities
  • Data persistence via SQLite
  • Simple Streamlit UI for non-technical users

Tech Stack

| Component | Purpose | |------------|----------| | Python 3.10+ | Core logic and data processing | | SQLite3 | Lightweight local database | | Pandas | CSV and data analysis | | Matplotlib | Chart generation | | Streamlit | Interactive web interface | | CSV Generator | Creates realistic price datasets |

Project Structure

community-price-tracker/
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ prices.db               # SQLite database
โ”‚   โ”œโ”€โ”€ generated_prices.csv    # Synthetic dataset
โ”‚
โ”œโ”€โ”€ outputs/
โ”‚   โ”œโ”€โ”€ trend_milk.png          # Sample trend chart
โ”‚   โ”œโ”€โ”€ basketbycity.png      # Basket comparison chart
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ schema.sql              # Database schema
โ”‚   โ”œโ”€โ”€ db.py                   # SQLite helper functions
โ”‚   โ”œโ”€โ”€ init_db.py              # Initializes DB
โ”‚   โ”œโ”€โ”€ generate_data.py        # Generates synthetic CSV data
โ”‚   โ”œโ”€โ”€ import_csv.py           # Imports CSV โ†’ normalized schema
โ”‚   โ”œโ”€โ”€ analytics.py            # Generates charts
โ”‚   โ”œโ”€โ”€ streamlit_app.py        # Interactive web app
โ”‚   โ”œโ”€โ”€ additem.py / addstore.py / addprice.py / listdata.py
โ”‚
โ””โ”€โ”€ README.md

Installation & Setup

Clone or download

git clone https://github.com/<your-username>/community-price-tracker.git
cd community-price-tracker

Create a virtual environment

python -m venv .venv
.venv\Scripts\activate       # (Windows)

source .venv/bin/activate # (macOS/Linux)

Install dependencies

pip install -r requirements.txt

Initialize the database

python src/init_db.py

Generate and Import Data

Generate synthetic price data

python src/generate_data.py
This creates:
data/generated_prices.csv
containing 1000 random records for multiple items and cities.

Import data into SQLite

python src/importcsv.py --file data/generatedprices.csv
Automatically:
  • Creates new items and stores
  • Inserts prices with correct relations

Verify Your Data

List whatโ€™s inside the database:
python src/list_data.py
Expected output:
Items
| id | name   | unit  |
|----|--------|-------|
| 1  | Milk   | liter |
| 2  | Bread  | loaf  |

Stores | id | name | city | |----|---------------|----------| | 1 | Market 1 | Helsinki |

Prices | item | store | city | price | date | |------|--------|----------|-------|------------| | Milk | Market 1 | Helsinki | 1.35 | 2025-10-26 |


Analytics & Charts

Generate a price trend chart

python src/analytics.py --item Milk --outdir outputs
Creates:
outputs/trend_milk.png

Compare basket cost across cities

python src/analytics.py --basket Milk Bread Eggs --outdir outputs
Creates:
outputs/basketbycity.png

Example Output:

Milk Price Trend trend_milk


Basket Cost by City basket<em>by</em>city


Run the Streamlit App

streamlit run src/streamlit_app.py

Web Features:

  • Log new items, stores, and prices
  • View recent entries
  • Trend charts by item
  • Compare basket costs
  • 100% local and privacy-friendly

Database Schema

| Table | Columns | |--------|----------| | item | id, name, category, unit | | store | id, name, city, latitude, longitude | | price | id, itemid, storeid, price, currency, quantity, date |

Indexed for faster queries on (itemid, date) and (storeid, date).

Example Use Case

Community volunteers across different cities can:
  • Log weekly prices for essential goods
  • Visualize price inflation patterns
  • Compare living costs between regions
  • Share insights for economic awareness

Screenshot Gallery (Placeholders)

Trends Tab

Screenshot 2025-10-27 at 10-47-32 Community Price Tracker


Basket Comparison

Screenshot 2025-10-27 at 10-46-38 Community Price Tracker


Future Enhancements

  • Export charts as PDF reports
  • Geolocation map view
  • Price change notifications
  • ML model for price forecasting
๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท AmirhosseinHonardoust/Community-Price-Tracker ยท Updated daily from GitHub