Small, dependency-free Python models for what India's oil marketing companies earn at the pump, how that changes at E20, E25 and E30 ethanol blends, and how many vehicles are actually on the road burning fuel.
Open-Source Tools · How-To · Energy & fuels models
How to use india-omc-fuel-fleet-model: ethanol blend scenarios and OMC pump income in pure Python
Revised
· v1.0.0 · what changed
Code: github.com/herrrickshaw/india-omc-fuel-fleet-model
Watch the walkthrough
Watch on YouTube: youtu.be/vRj87yeDMew
Why it is useful
- Energy analysts, students and journalists get a transparent, editable model of an argument that is usually made in prose: blended fuel has less energy per litre, so vehicles buy more litres, and per-litre margins and taxes scale with it.
- It replaces a spreadsheet nobody can audit: the main model is one readable script using only the standard library, and every assumption is in the code.
- Evidence from the run: omc_model.py, fleet_from_fuel.py and energy_blend_comparison.py all ran in a fresh clone with no installs and printed the headline numbers the README quotes, and the extra-litre figures in two different scripts reconcile (2.16 billion litres at E20).
- The run also surfaced a modelling choice worth knowing: the OMC model uses a 4% mileage drop at E20, while the pure energy-content table implies about 7%. The post explains the difference.
What it is for
The repo models India's oil marketing company (OMC) retail margin on petrol and diesel from PPAC reference data, and what changes when petrol is blended with 20, 25 or 30 percent ethanol. The key mechanism is that a mileage penalty makes drivers buy more litres, which raises pump throughput and so OMC income.
Other scripts estimate how many vehicles are actively driven from fuel sales, compare energy content of blends, test price-parity scenarios and sketch CBG, distillery, DME and isobutanol investment cases. This post focuses on the blend-scenario model and the fleet estimate.
Who it is for
- Students and analysts studying India's ethanol blending policy
- Journalists and researchers who want to test assumptions rather than quote headlines
- Developers extending a small, readable fuel-economics model
- Investment advice: this is not investment advice, and the OMC margin is an assumption, described by the README as the key lever
- Policy or tax decisions without checking inputs against current official figures
- Detailed engineering or project-finance design; the pitch models are conceptual
What you need
| Requirement | Why | How to get it |
|---|---|---|
| Python 3 (standard library only for the main scripts) | requirements.txt notes omc_model.py, fleet_from_fuel.py and the Vahan analysis are pure standard library | python.org, or brew install python on macOS |
| openpyxl (optional) | Only the Excel builder (build_xlsx.py) needs it | pip install -r requirements.txt |
| Node.js (optional) | Only the slide and document builders (build_*.js) need it; not used in this demo | nodejs.org |
| A terminal and git | To clone and run | Terminal on macOS/Linux, or Git Bash/WSL on Windows |
| No API keys or accounts | Inputs are embedded in the code and repo files | None needed |
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/india-omc-fuel-fleet-model.git
cd india-omc-fuel-fleet-model
claude # or: gemini
Install
- Clone and enter the repo
git clone https://github.com/herrrickshaw/india-omc-fuel-fleet-model.git cd india-omc-fuel-fleet-model - Optional: install openpyxl for the Excel builder only
python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt
Quick start: commands and what you should see
Run the OMC profitability and blend-scenario model
python3 omc_model.py
Five lines: base OMC gross, extra pump income at E20/E25/E30, mix scenarios S0 to S4, the YoY projection, and the files it wrote under outputs/.
Estimate the actively driven fleet from fuel sales
python3 fleet_from_fuel.py
Totals by fuel and a segment table; about 24.5 crore actively driven vehicles.
Compare blends by energy content and who collects the extra spend
python3 energy_blend_comparison.py
An energy table for E10 to E30, isobutanol and biodiesel blends, then consumer spend, excise, VAT, dealer and OMC shares per blend.
Sample outputs
Real output from a run on the date shown in the sources line; trimmed to fit.
omc_model.py (run 19 Oct 2026, 0.05 s)
python3 omc_model.py
Base FY24-25: OMC retail gross ≈ ₹46,449 cr/yr (petrol ₹18,919 + diesel ₹27,530)
Ethanol extra pump income: E20 ₹757 cr | E25 ₹1,057 cr | E30 ₹1,367 cr
Mix scenarios (OMC petrol income ₹cr): S0 ₹18,881 | S1 ₹18,919 | S2 ₹19,017 | S3 ₹19,153 | S4 ₹19,322
YoY projection FY25-26→FY29-30: ₹46,449 → ₹56,560 cr
All rupee figures in crore (₹ crore = ten million rupees) per year.
Blend scenario table (outputs/scenarios.csv, billion litres)
cat outputs/scenarios.csv
scenario blend mileage_drop petrol_MS ethanol extra_throughput extra_OMC_cr
E0 0.00 0.000 51.89 0.00 0.00 0
E20 0.20 0.040 43.24 10.81 2.16 757
E25 0.25 0.055 41.18 13.73 3.02 1,057
E30 0.30 0.070 39.06 16.74 3.91 1,367
Pure petrol sold falls as ethanol rises, while total pump throughput rises.
Profitability projection (outputs/yoy_projection.csv)
cat outputs/yoy_projection.csv
fy blend outlets omc_income_cr yoy_growth_cr
FY25-26 E20 99,281 46,449 -
FY26-27 E20 103,749 48,591 2,142
FY27-28 E25 108,417 51,195 2,605
FY28-29 E25 113,296 53,606 2,411
FY29-30 E30 118,394 56,560 2,954
A model projection under the repo's assumptions, not a forecast.
energy_blend_comparison.py (excerpt)
python3 energy_blend_comparison.py
E20 29.92 MJ/L energy −6.83% extra litres +7.33%
E30 28.82 MJ/L energy −10.25% extra litres +11.42%
E20 extra 2.16 bnL consumer ₹22,703 cr excise ₹4,303 cr VAT ₹4,216 cr dealer ₹886 cr OMC ₹757 cr
The 2.16 billion litre E20 figure matches omc_model.py, so the two scripts reconcile.
Ways to use it
| Method | How it works |
|---|---|
| Command line scripts | Run omc_model.py, fleet_from_fuel.py, energy_blend_comparison.py and the others; results land in outputs/ as CSV and Markdown. |
| Edit the assumptions | Change blend shares, mileage drops or margins in the script and re-run; each run takes well under a second. |
| Excel and slide builders | build_xlsx.py (needs openpyxl) and the Node build_*.js scripts produce the workbook, papers and decks in docs/. Not run in this demo. |
| Through an AI assistant | Open the cloned folder in Claude Code or Gemini CLI and ask it to change an assumption and explain the result. |
Sample prompts for your AI assistant
Copy, paste and edit the parts in [brackets].
- Explain this repository in plain English: what does omc_model.py calculate and which assumptions drive the answer?
- Run omc_model.py with a [percent] OMC margin instead of the default and show how the E20, E25 and E30 extra income change.
- Why does omc_model.py use a 4% mileage drop at E20 while energy_blend_comparison.py implies about 7%? Which should I use and why?
- Read fleet_from_fuel.py and list every assumption behind the 24.5 crore figure, then show the effect of changing two-wheeler daily fuel use by 20%.
- Summarise the caveats in the README's CBG section in five bullet points for a non-specialist.
Limits and honest caveats
- Not investment advice. The README itself calls the headline results illustrative and the OMC margin the key lever.
- The mileage-drop assumption (4% at E20) is lower than the energy-content estimate (about 6.8% less energy per litre, 7.3% more litres). The scripts reconcile with each other, but the chosen real-world mileage drop drives the extra-income result.
- The YoY table labels its first row FY25-26 while the base is labelled FY24-25 in the model output; both show the same 46,449, so read the first row as the base year.
- Inputs are PPAC and other figures embedded in the repo; I did not re-verify them against the sources and they will age.
- I ran only the Python models. The Excel builder, the Node slide and document builders and the investment-pitch models were not run.
- The CBG, DME and isobutanol pitch models are conceptual and are not investment advice.
- The README says CBG fed into CNG does not cut mileage, so the extra-throughput mechanism applies to ethanol in petrol only.
Sources: the india-omc-fuel-fleet-model README and the scripts omc_model.py, fleet_from_fuel.py and energy_blend_comparison.py, run on 19 October 2026 on a fresh clone.
- 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.