A set of pandas scripts, CSV results and markdown write-ups on India's commodity exports from TradeStat, with a shortlist of fast-growing export lines. You can explore the committed results without the raw data. The repository is archived and read-only. Trade analysis, not investment advice.
Open-Source Tools · How-To · Policy analysis
How to use india-trade-export-analysis: read India's 2020-2023 export data and the high-growth shortlist
Revised
· v1.0.0 · what changed
Code: github.com/herrrickshaw/india-trade-export-analysis
Watch the walkthrough
Watch on YouTube: youtu.be/_tfs7QhKoTc
Why it is useful
- Who benefits: students and trade analysts who want a ready commodity-level export table (HS code, 2020 value, 2023 value, growth) without downloading TradeStat themselves.
- What it replaces: the first day of cleaning TradeStat spreadsheets. The results are already in CSV and JSON.
- Evidence from our run: we loaded the committed 14,980-row CSV in pandas and recovered the headline totals, US$291.8 bn in 2020 and US$437.7 bn in 2023.
- Evidence of limits: the line items sum to US$460.5 bn, about 5% more than the total row, so the table is not a clean partition of exports.
- The scripts need raw TradeStat Excel files that are not in the repository, so they could not be re-run.
What it is for
The repo's Python scripts read TradeStat Excel exports, compute growth between 2020 and 2023, project 2025 and 2026 by extending that growth, and classify commodities as mega-growth, high-value growing or emerging opportunity. Markdown write-ups discuss reserves, tax and debt. The README describes it as indicative analysis from public sources, not official statistics.
This guide shows how to explore the committed outputs. It is trade analysis for learning, not investment or business advice. The repository is archived (read-only).
Who it is for
- Students of international trade and Indian export structure
- Analysts who want a starting commodity table to verify against the official source
- Anyone learning how a growth-and-projection screen is built, and where it breaks
- Investment or trading decisions
- Citing the 2025-2026 projections: they extend one historical growth rate
- Treating the 'opportunity' shortlist as a recommendation without checking classification changes
What you need
| Requirement | Why | How to get it |
|---|---|---|
| Python 3 with pandas | to read the CSV and JSON files | pip install pandas in a virtual environment |
| TradeStat export workbooks (optional) | the scripts read them from a hard-coded Downloads path | download from the official TradeStat portal and edit the paths; we did not do this |
| Not needed | no API key or GPU | the committed results are enough to explore |
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-trade-export-analysis.git
cd india-trade-export-analysis
claude # or: gemini
Install
- Get the code
git clone https://github.com/herrrickshaw/india-trade-export-analysis.git cd india-trade-export-analysis - Make a virtual environment and install pandas
python3 -m venv .venv .venv/bin/pip install pandas
Quick start: commands and what you should see
Load the extended table and read the totals
.venv/bin/python -c "import pandas as pd; d=pd.read_csv('EXTENDED_ANALYSIS_2020_2026.csv'); print(d.shape); print(d.iloc[0])"
14,980 rows and 7 columns; the first row is India's total export with values for 2020 and 2023 in US$ million.
Count the opportunity classes
.venv/bin/python -c "import pandas as pd; print(pd.read_csv('HIGH_OPPORTUNITY_EXPORTS.csv').Opportunity.value_counts())"
Three classes with 246, 41 and 6 commodities.
Run a script (needs raw data)
.venv/bin/python export_opportunities.py
Without the TradeStat workbooks and Downloads folder it cannot run. We did not run it.
Sample outputs
Real output from a run on the date shown in the sources line; trimmed to fit.
Totals versus the sum of line items
python3 -I (pandas, EXTENDED_ANALYSIS_2020_2026.csv)
total row 2020: 291808.48 2023: 437704.58 (USD mn)
sum of 14,979 line items, 2023: 460,482.7 (USD mn)
total row 2023: 437,704.6 (USD mn)
The total row and the line items disagree by about US$22.8 bn (5%). Do not add the total row to the line items.
Opportunity classes
HIGH_OPPORTUNITY_EXPORTS.csv, value_counts of Opportunity
Opportunity
EMERGING_OPPORTUNITY 246
HIGH_VALUE_GROWING 41
MEGA_GROWTH 6
(293 rows)
The 293 rows include the all-India total row.
The six mega-growth lines (first five shown)
MEGA_GROWTH_EXPORTS.csv, values rounded
Commodity (HS code) 2020 $M 2023 $M growth
Automotive diesel (27101944) 8,800.8 19,455.9 121.1%
Aviation turbine fuel (27101939) 430.1 15,202.7 3435.0%
Motor gasoline (27101241) 3,645.8 10,502.9 188.1%
Aeroplanes >15,000 kg (88024000) 115.8 5,544.5 4689.3%
Motor cars 1000-1500cc (87032291) 1,983.8 5,098.6 157.0%
Aviation fuel (+3,435%) and aircraft (+4,689%) start from very small 2020 bases; a change in HS classification or one large delivery could explain this, which the repo does not test. The column is labelled 5-year growth but compares 2020 with 2023.
Ways to use it
| Method | How it works |
|---|---|
| Explore in a notebook | Open the CSVs in pandas and filter by HS code or growth. |
| Verify against TradeStat | Pick five shortlisted lines and compare the 2020 and 2023 values with the official portal. |
| Rebuild with current data | Use the scripts as a template with your own newer TradeStat downloads. |
Sample prompts for your AI assistant
Copy, paste and edit the parts in [brackets].
- Read README.md and export_opportunities.py and explain how a commodity becomes MEGA_GROWTH.
- Load EXTENDED_ANALYSIS_2020_2026.csv, drop the total row, and list the top 10 HS codes by 2023 value.
- Check whether the large growth rates in HIGH_OPPORTUNITY_EXPORTS.csv come from tiny 2020 bases and flag them.
- Explain why the line items sum to more than the India's Total Export row and suggest a fix.
- Adapt export_extended_analysis.py to take a folder path as an argument instead of ~/Downloads.
Limits and honest caveats
- Scripts depend on raw TradeStat workbooks and hard-coded personal Downloads paths that are not in the repository; we could not re-run them.
- Line items sum to US$460.5 bn against a US$437.7 bn total row (5% gap).
- Projections to 2025 and 2026 repeat the 2020-2023 growth rate (the total row shows the same 50.0% again), so they are extrapolation, not a forecast.
- Growth labelled 5-year covers 2020 to 2023; very large percentages come from small bases.
- Indicative analysis from public sources, not official statistics, not investment advice. The repository is archived.
Sources: Repository herrrickshaw/india-trade-export-analysis (archived), committed CSV/JSON files read with pandas on 2026-10-23 in a throwaway virtual environment; the Python scripts were not run because their input workbooks are absent.
- v1.0.0 — 23 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.