A research and data repository on India's foodgrain procurement: the MSP series, mandi prices against MSP, FCI stocks and storage, a dashboard, and small Python models for holding economics and grain processing.
Open-Source Tools · How-To · Policy analysis
How to use FCI-warehouse-MSPvsMSV: grain procurement, MSP and mandi-price data with working models
Revised
· v1.0.0 · what changed
Code: github.com/herrrickshaw/FCI-warehouse-MSPvsMSV
Watch the walkthrough
Watch on YouTube: youtu.be/KdOY3vWwzuM
Why it is useful
- Agricultural-policy analysts, journalists and students asking 'does MSP actually hold in the market?' get a ready table of mandi modal prices against MSP, crop by crop, with sources recorded in a manifest.
- It replaces stitching together CACP, Agmarknet, DFPD bulletins and FCI data by hand. The data/ folder holds 49 CSVs, and data/MANIFEST.md says where each came from and what is missing.
- Evidence from the run: the mandi table shows 92% of bajra and 84% of moong market reports below MSP on 23 July 2026, against 19% for wheat. Two models also ran unchanged in a fresh environment.
- The holding-economics model produced a clear result: for every commodity tested, estimated storage and financing cost exceeded price appreciation over 12, 24 and 36 months, which bears directly on the 'why not buy and hold' question behind MSV.
What it is for
FCI-warehouse-MSPvsMSV evaluates whether a Minimum Support Volume guarantee could extend effective price support beyond rice and wheat. It contains cited reports (report/), CSV data with a provenance manifest (data/), a self-contained HTML dashboard (dashboard/), a Colab notebook, and several Python models: holding economics, OMSS grain-processing unit economics, rice-bran oil savings, and a real farm income index.
This post uses the MSP series, the mandi-vs-MSP table and the two models that ran cleanly.
Who it is for
- Agricultural-economics students and researchers
- Journalists covering procurement, MSP and food stocks
- Policy teams comparing price-support designs
- Developers wanting a worked, sourced Indian agri dataset
- Investment or trading advice: this is not investment advice
- Official statistics: figures are compiled from published sources and not audited
- Farm-level decisions: models are stylised unit economics, not forecasts
What you need
| Requirement | Why | How to get it |
|---|---|---|
| Python 3 with pandas and numpy | holding_economics.py uses both; the processing model needs neither | pip install pandas numpy |
| git | To clone | Pre-installed on most systems |
| A web browser | To open dashboard/index.html | Any modern browser |
Get the code and an AI assistant
You do not have to be a programmer. Get the repository, give it to an AI assistant, and ask in plain language. Any of these routes works:
| Tool | What you need | Best for |
|---|---|---|
| GitHub | Free account to fork or star; git to clone, or the green Code button, then Download ZIP, or open in Codespaces | Getting the code and keeping up with updates |
| Claude Code | Claude subscription or API key; run claude inside the cloned folder | Letting the AI read and run the whole repo |
| Gemini CLI | Google account; run gemini inside the cloned folder | The same hands-on workflow with Gemini |
| Claude.ai, Gemini or ChatGPT in the browser | A chat account; upload README.md and the files you care about (or paste the output of git ls-files) | Understanding the project and asking questions without installing anything |
| Other tools (Copilot Chat, Cursor, Codex CLI) | Open the cloned folder in the tool and point it at README.md first | Editing and extending the code |
git clone https://github.com/herrrickshaw/FCI-warehouse-MSPvsMSV.git
cd FCI-warehouse-MSPvsMSV
claude # or: gemini
Install
- Clone the repository
git clone https://github.com/herrrickshaw/FCI-warehouse-MSPvsMSV.git cd FCI-warehouse-MSPvsMSV - Create an environment and install dependencies
python3 -m venv .venv && source .venv/bin/activate pip install pandas numpy
Quick start: commands and what you should see
View the MSP vs mandi table
cat data/mandi_vs_msp_20260723.csv
16 crops with MSP, number of market reports, median modal price, share of reports below MSP and median gap.
Run the grain-processing unit-economics model
cd data && python3 omss_processing_model.py
EBITDA per quintal for wheat-to-atta and paddy-to-rice, plus a 300 TPD flour-mill scale case.
Run the holding-economics model
cd data && python3 holding_economics.py
Summary, horizon-return and post-crash-episode tables per commodity; it rewrites three CSVs next to the script, so run it in a copy if you want the repo untouched.
Sample outputs
Real output from a run on the date shown in the sources line; trimmed to fit.
MSP vs mandi sample table (data/mandi_vs_msp_20260723.csv)
crop MSP 2025-26 market reports modal median % reports below MSP median gap vs MSP
wheat 2425 768 2500.0 19 +3%
paddy 2369 335 2385.0 36 +1%
gram 5650 231 5900.0 22 +4%
maize 2400 226 2200.0 75 -8%
soybean 5328 195 7050.0 2 +32%
moong 8768 161 6901.0 84 -21%
tur 8000 129 7531.0 70 -6%
bajra 2775 84 2382.0 92 -14%
ragi 4886 14 3550.0 93 -27%
Prices in Rs per quintal. Trimmed from 16 crops. Built from the 23 July 2026 Agmarknet daily feed (17,247 records) per MANIFEST.md. Crops with few reports (ragi 14, sunflower 2) are thin evidence.
Holding economics (14-year window, % per year)
commodity price CAGR carry cost net annual verdict
paddy 4.84 20.33 -15.48 CARRY EXCEEDS APPRECIATION
wheat 5.19 16.99 -11.80 CARRY EXCEEDS APPRECIATION
maize 3.81 18.50 -14.69 CARRY EXCEEDS APPRECIATION
arhar_tur 5.74 13.67 -7.93 CARRY EXCEEDS APPRECIATION
sugar 2.33 16.59 -14.26 CARRY EXCEEDS APPRECIATION
Rows trimmed; all 16 commodities show the same verdict. Carry costs combine storage tariffs and financing assumptions that are cited in the repo's report, not in this output.
Grain-processing unit economics
python3 omss_processing_model.py
WHEAT->ATTA OMSS-sourced: grain 2550 | revenue 2926 | gross 376 | EBITDA 196/qtl (6.7% margin)
WHEAT->ATTA mandi-sourced: grain 2500 | revenue 2926 | gross 426 | EBITDA 246/qtl (8.4% margin)
PADDY->RICE open-market: paddy 2385 | revenue 2520 | EBITDA -15/qtl (-0.6% margin)
SCALE: 300 TPD flour mill | EBITDA Rs 17.6 cr | capital employed ~Rs 80 cr | ROCE ~22%
Deterministic model with labelled input assumptions, not a forecast.
Ways to use it
| Method | How it works |
|---|---|
| Open the dashboard | dashboard/index.html is self-contained; open it in a browser (add ?theme=dark for dark mode). |
| Query the CSVs | Load msp_series.csv, procurement_by_year.csv or stocks_vs_norms.csv in pandas or DuckDB. |
| Colab notebook | The README links a Colab notebook that reproduces the charts. |
| Through an AI assistant | Open the clone in Claude Code or Gemini CLI, or upload README.md, MANIFEST.md and a CSV to a chat assistant. |
Sample prompts for your AI assistant
Copy, paste and edit the parts in [brackets].
- Read data/MANIFEST.md and list which datasets cover procurement, stocks, storage and prices, with their known gaps.
- Using data/msp_series.csv, compute the MSP CAGR for wheat and paddy since 2010-11 and chart both.
- From mandi_vs_msp_20260723.csv, which crops have more than half of market reports below MSP? Why might the sample sizes matter?
- Explain the assumptions in holding_economics.py and which one the verdict is most sensitive to.
- Summarise the case for and against a Minimum Support Volume from report/msp-vs-msv-main-report.md in 200 words.
Limits and honest caveats
- Not investment advice. Figures are compiled from public sources and unaudited.
- Year labels differ between files. In msp_series.csv the year is the sowing year, so the rabi wheat MSP of Rs 2,425 sits under 2024-25 and Rs 2,585 under 2025-26, whereas mandi_vs_msp_20260723.csv uses the marketing-year MSP (wheat Rs 2,425 for 2025-26). Check the label before joining the two.
- The mandi comparison is one day (23 July 2026) and includes crops with very few reports.
- The holding-economics verdict depends on assumed carry rates (storage tariffs and financing) and WPI price series; it is not a forecast. Running it rewrites its three output CSVs.
- The repo includes some company financials taken from screener.in; I did not use or reproduce them, and you should check licensing before reusing that file.
- I did not run the other models (biodiesel, RBO savings, farm income index) or the dashboard, and the mandi data's upstream collection was not re-run.
Sources: the FCI-warehouse-MSPvsMSV README, data/MANIFEST.md, data/msp_series.csv, data/mandi_vs_msp_20260723.csv and the Python models; omss_processing_model.py and holding_economics.py run on 19 October 2026 on a copy of the data folder (latest commit 3 October 2026).
- v1.0.0 — 19 October 2026 — first published.
About this article: Researched, written and edited by Umashankar Triplicane Dwarakanathan, with AI research assistance; every figure is meant to trace to the primary source cited. See the Editorial Policy for how sourcing, AI use and corrections work.