Spaces:
Sleeping
Sleeping
| title: AgriPredict | |
| emoji: πΎ | |
| colorFrom: green | |
| colorTo: yellow | |
| sdk: streamlit | |
| sdk_version: "1.49.1" | |
| app_file: streamlit_app.py | |
| pinned: false | |
| # AgriPredict (Refactor) | |
| AgriPredict is a refactored, modular, and production-ready version of the original Streamlit-based price forecasting dashboard. | |
| This version focuses on better structure, maintainability, and performance. | |
| --- | |
| ## π Project Structure | |
| ``` | |
| src/agri_predict/ | |
| β | |
| βββ config.py # Environment variables, MongoDB client setup | |
| βββ constants.py # Shared constant mappings (states, markets, crops etc.) | |
| βββ features.py # Feature engineering functions | |
| βββ data.py # Data access, scraping, cleaning, preprocessing | |
| βββ models.py # Model training, forecasting, grid search | |
| βββ plotting.py # Plot utilities, downloads | |
| βββ utils.py # Authentication + general helpers | |
| streamlit_app.py # Streamlit UI entrypoint | |
| requirements.txt # Python dependencies | |
| ``` | |
| --- | |
| ## βΆοΈ Run Locally | |
| ### 1. Create and activate a virtual environment: | |
| ```bash | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| ``` | |
| ### 2. Install dependencies: | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| ### 3. Set up environment variables | |
| Create a `.env` file in the **project root**: | |
| ``` | |
| MONGO_URI=your_mongo_connection_string | |
| ``` | |
| ### 4. Start the Streamlit app: | |
| ```bash | |
| streamlit run streamlit_app.py | |
| ``` | |
| --- | |
| ## π Deploy on Hugging Face Spaces | |
| This README already includes the required HF metadata block at the top. | |
| Hugging Face Spaces will automatically run: | |
| ``` | |
| streamlit run streamlit_app.py | |
| ``` | |
| No additional configuration is needed. | |
| --- |