Sell-or-Store is an AI-powered decision support system that helps farmers decide whether to sell their harvested crops immediately or store them for better returns. It uses machine learning, weather forecasts, mandi prices, and storage cost analysis to predict future prices and provide explainable, data-driven recommendations through an interactive
# πΎ Sell-or-Store: AI-Based Crop Sale Timing Assistant for Farmers
A Decision Support System (not an automated decision maker) that helps farmers decide
whether to **sell** their harvested crop now or **store** it a while longer, using
live weather, mandi price data, and machine learning.
## β¨ Features
| Feature | Details |
|---|---|
| π¦οΈ Real-time weather | OpenWeather API integration (falls back to simulated data if no key) |
| πͺ Real mandi prices | data.gov.in / Agmarknet integration (falls back to simulated data if no key) |
| π€ Better ML model | Random Forest (default) or XGBoost price prediction with engineered time-series features |
| π PDF report | One-click downloadable recommendation report (fpdf2) |
| π Multi-language | English, Hindi (ΰ€Ήΰ€Ώΰ€ΰ€¦ΰ₯), Kannada (ΰ²ΰ²¨ΰ³ΰ²¨ΰ²‘) |
| π Farmer authentication | Simple username/password login & registration (local JSON store) |
| π Nearby mandi recommendation | Ranks nearby mandis by a blend of price and distance |
| π° Storage cost estimation | Rs/kg/day storage cost modelling per crop |
| π Profit-if-stored estimation | Compares net revenue of selling now vs. storing, incl. spoilage loss |
| π Interactive dashboard | Plotly charts (line, bar) replacing static Matplotlib |
| π§ Explainable AI | Shows top factors behind both the price prediction and the SELL/STORE decision |
| π± Mobile-friendly | Responsive CSS breakpoints and Streamlit wide layout |
## ποΈ Project Structure
```
Sell_or_Store/
βββ app.py # Main Streamlit dashboard
βββ auth.py # Farmer authentication (register/login)
βββ crop_data.py # Crop knowledge base
βββ weather_api.py # OpenWeather integration
βββ mandi_data.py # data.gov.in / Agmarknet integration + nearby mandi ranking
βββ ml_model.py # Random Forest / XGBoost price prediction
βββ decision_engine.py # Combines everything into a SELL/STORE/CAUTION decision
βββ storage_economics.py # Storage cost & profit-if-stored cal β¦