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 …