ThejasRao commited on
Commit
1fd990b
Β·
1 Parent(s): fa4fc8b

Fix: Readme

Browse files
Files changed (1) hide show
  1. README.md +79 -16
README.md CHANGED
@@ -1,34 +1,97 @@
 
 
 
 
 
 
 
 
 
1
  # AgriPredict (Refactor)
2
 
3
- This repository contains a refactored, modularized version of the Streamlit-based AgriPredict dashboard.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- Structure:
6
 
7
- - `src/agri_predict` - package with modules:
8
- - `config.py` - env & MongoDB connection helpers
9
- - `constants.py` - shared constants (state/market mapping)
10
- - `features.py` - feature engineering functions
11
- - `data.py` - data access, preprocessing and scraping helpers
12
- - `models.py` - model training, grid search and forecasting
13
- - `plotting.py` - plotting and download helpers
14
- - `utils.py` - authentication and utility functions
15
- - `streamlit_app.py` - Streamlit entrypoint
16
- - `requirements.txt` - Python dependencies
17
 
18
- Run locally:
19
 
20
- 1. Create a virtualenv and install dependencies:
21
 
22
  ```bash
23
  python -m venv .venv
24
  source .venv/bin/activate
 
 
 
 
 
25
  pip install -r requirements.txt
26
  ```
27
 
28
- 2. Set `MONGO_URI` in a `.env` file at project root.
 
 
 
 
 
 
29
 
30
- 3. Start the app:
31
 
32
  ```bash
33
  streamlit run streamlit_app.py
34
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```
2
+ ---
3
+ title: AgriPredict
4
+ emoji: 🌾
5
+ sdk: streamlit
6
+ app_file: streamlit_app.py
7
+ pinned: false
8
+ ---
9
+
10
  # AgriPredict (Refactor)
11
 
12
+ AgriPredict is a refactored, modular, and production-ready version of the original Streamlit-based price forecasting dashboard.
13
+ This version focuses on better structure, maintainability, and performance.
14
+
15
+ ---
16
+
17
+ ## πŸ“ Project Structure
18
+
19
+ ```
20
+
21
+ src/agri_predict/
22
+ β”‚
23
+ β”œβ”€β”€ config.py # Environment variables, MongoDB client setup
24
+ β”œβ”€β”€ constants.py # Shared constant mappings (states, markets, crops etc.)
25
+ β”œβ”€β”€ features.py # Feature engineering functions
26
+ β”œβ”€β”€ data.py # Data access, scraping, cleaning, preprocessing
27
+ β”œβ”€β”€ models.py # Model training, forecasting, grid search
28
+ β”œβ”€β”€ plotting.py # Plot utilities, downloads
29
+ └── utils.py # Authentication + general helpers
30
+
31
+ streamlit_app.py # Streamlit UI entrypoint
32
+ requirements.txt # Python dependencies
33
 
34
+ ````
35
 
36
+ ---
 
 
 
 
 
 
 
 
 
37
 
38
+ ## ▢️ Run Locally
39
 
40
+ ### 1. Create and activate a virtual environment:
41
 
42
  ```bash
43
  python -m venv .venv
44
  source .venv/bin/activate
45
+ ````
46
+
47
+ ### 2. Install dependencies:
48
+
49
+ ```bash
50
  pip install -r requirements.txt
51
  ```
52
 
53
+ ### 3. Set up environment variables
54
+
55
+ Create a `.env` file in the **project root**:
56
+
57
+ ```
58
+ MONGO_URI=your_mongo_connection_string
59
+ ```
60
 
61
+ ### 4. Start the Streamlit app:
62
 
63
  ```bash
64
  streamlit run streamlit_app.py
65
  ```
66
+
67
+ ---
68
+
69
+ ## πŸš€ Deploy on Hugging Face Spaces
70
+
71
+ This README already includes the required HF metadata block at the top:
72
+
73
+ ```md
74
+ ---
75
+ title: AgriPredict
76
+ emoji: 🌾
77
+ sdk: streamlit
78
+ app_file: streamlit_app.py
79
+ pinned: false
80
+ ---
81
+ ```
82
+
83
+ Hugging Face will automatically run:
84
+
85
+ ```
86
+ streamlit run streamlit_app.py
87
+ ```
88
+
89
+ No extra configuration needed.
90
+
91
+ ---
92
+
93
+ ## πŸ“¬ Contact
94
+
95
+ If you face any issues deploying to Hugging Face, reach out or open an issue in the repository.
96
+
97
+ ```