FarmX is a Streamlit app for crop planning. It combines yield estimation with soil nutrient predictions so growers can compare crops, estimate projected yield, and inspect model-backed nitrogen, phosphorus, and potassium recommendations.
- Projected yield calculator for 22 supported crops
- Side-by-side crop yield comparison
- Model-backed N, P, and K category predictions
- Predicted nitrogen value in kg/ha
- Curated soil testing and agricultural resource links
.
├── app.py # Streamlit entry point
├── cost.py # Yield estimation logic
├── functions.py # Model training and prediction helpers
├── farmx/ # Shared app metadata
├── data/ # Training dataset
├── models/ # Committed model/scaler artifacts used by Streamlit
├── assets/ # Logo and favicon assets
└── train-models.py # Regenerates model pickle files from the dataset
The models/*.pkl files are intentionally committed because the Streamlit app loads them at runtime.
Create the locked environment and install its dependencies:
uv syncRun the app:
uv run streamlit run app.pyThe app will be available at http://localhost:8501.
If the dataset or feature engineering changes, regenerate the model artifacts:
uv run python train-models.pyThis updates the pickle files in models/.
Dependencies are declared in pyproject.toml and reproducibly pinned in uv.lock. requests and streamlit are bounded above the vulnerable ranges reported by Dependabot.