Mehngai Monitor collects daily Lahore market rates for fruits, vegetables, and poultry, then shows them in a web dashboard.
- Scrapes official Lahore market rate list images
- Runs OCR with Gemini and normalizes extracted rows
- Stores clean data in SQLite
- Serves dashboard, analytics, and item trend pages with FastAPI
git clone <your-repo-url>
cd "Mehngai Monitor"
python -m venv .venv
# Windows PowerShell
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtCreate a .env file in the project root:
GEMINI_API_KEY=your_api_key_hereRun the app:
python main.pypython scraper.py
python ocr.py
python -m unittest test_normalizer -v- FastAPI + Jinja2
- SQLite
- APScheduler
- requests + BeautifulSoup
- Tailwind CSS + Plotly
- OCR quality depends on source image quality and Gemini extraction output.
https://lahore.punjab.gov.pk/market_rates
See DEPLOYMENT.md for Linux/systemd setup.