Project Info
Inspiration
I have been a quant researcher for the last 8 years and whenever I need macroeconomic data, my go-to has always been the FRED API. I wanted something similar for India as well. There are a lot of public data sources available in India. For example, the Reserve Bank of India, or RBI, publishes a large amount of statistical data on its website. But there is no common Python library that I can reference for extracting and working with this data in a clean, research-friendly way. That gap was the inspiration for IndiaMacro: making Indian macroeconomic data easier to access, while respecting the reality that economic data is revised, published over time, and not always presented in a clean machine-readable format.
What it does
IndiaMacro is a Python library for reproducible, programmatic access to official Indian macroeconomic data. The current v0.2.0 release supports RBI Sectoral Deployment of Bank Credit data from verified RBI Bulletin issues published between July 2025 and June 2026. It provides: Current RBI Sectoral Credit data Historical published-vintage observations Explicit latest_publication and as_of resolution Offline replay from a versioned local cache Source provenance and deterministic hashes Strict parser contracts for known RBI source-layout transitions An optional Matplotlib visualization for Non-food Credit The important point is that it does not silently overwrite older published values. That matters for research, because using a revised value that was not available at the time can introduce look-ahead bias. ##
How we built it
I built IndiaMacro with ChatGPT and, specifically, Codex and GPT-5.6 Sol using an extra-high reasoning level. I gave GPT-5.6 Sol a goal: build a parser that can: Check the source data file Download a copy Study the contents Iterate over the parser Ensure that the data is extracted properly before it completes Codex helped turn that work into a proper Python package. It helped with the parser implementation, test coverage, validation, documentation, offline replay, provenance handling, packaging, and the reproducible demo. The project treats each publication as a vintage. Instead of trying to make one superficially clean time series, it preserves what RBI published at a particular point in time and lets the user explicitly choose a current or as_of view.
Challenges we ran into
The biggest challenge is that RBI data is often published in Excel workbooks with schemas that change over time. Even if you build a parser, it is still cumbersome to join different vintages and publication dates correctly. There are changing row layouts, changing date conventions, different growth columns, methodology changes, and revised values. It is also important not to overwrite already published data. That would be detrimental to research because it can introduce look-ahead bias. The data has to be point-in-time and preserve the publication context so there is data integrity. I had initially tried using a lower-intelligence model, but it essentially surrendered and said that I needed to manually download the files and provide them. GPT-5.6 Sol was different. It was tenacious: it continued through the difficult source formats, helped derive strict parser contracts, and kept validating the outputs rather than stopping at the first obstacle.
Accomplishments we're proud of
I am proud that IndiaMacro is not just a one-off spreadsheet extraction script. It now has: A released, installable Python package Verified support for 12 consecutive RBI Bulletin issues 5,950 published-vintage observations 3,060 current observations across 255 measure-specific series Explicit handling of historical revisions Strict support boundaries instead of silently guessing unsupported layouts Offline tests and replay A reproducible Non-food Credit example and visualization Public source code and release artifacts I am especially proud that the project keeps provenance, publication dates, source hashes, and methodology boundaries alongside the data. For quantitative research, those details are as important as the number itself.
What we learned
The biggest lesson was that collecting data is not the same as building research-grade data infrastructure. A clean-looking time series can still be misleading if it overwrites history, ignores revisions, uses data that was not known at the time, or quietly joins incompatible source layouts. I also learned how useful Codex and GPT-5.6 can be when the task is not simply “write some code.” This involved investigation, iteration, validation, source analysis, testing, release preparation, and the judgment to keep parser contracts strict.
What's next
IndiaMacro is just a start. It is far from over, but I see it as a fruitful endeavour. My aim is to continue building it as an open-source repository for quantitative researchers and for anybody interested in economics, finance, or macroeconomics who wants easier access to Indian data. The longer-term vision is AI-native data infrastructure for India’s economy: trustworthy, well-documented, point-in-time data that can be accessed programmatically and used confidently in research and analysis. I plan to add carefully verified sources over time, while keeping the same principles: strict contracts, reproducibility, provenance, explicit methodology boundaries, and no silent guessing. I hope to continue using Codex on this journey.
IndiaMacro
IndiaMacro is a focused, auditable data-access library for official Indian macroeconomic data. Version 0.2.0 is available as a GitHub release and covers one dataset: RBI Sectoral Deployment of Bank Credit from RBI Bulletin Current Statistics Tables 15 and 16.
Verified historical support currently covers the 12 Bulletin issues from July 2025 through June 2026. This is a tested IndiaMacro boundary, not the full availability of RBI data.
Built during OpenAI Build Week
IndiaMacro existed before Build Week as v0.1.0: a current-only RBI connector with the June 2026 parser, cache, provenance, and offline replay. During Build Week, v0.2.0 added the verified July 2025–June 2026 historical path, strict layout-transition parsers, published vintages, explicit resolution, optional plotting, portable CI, and a reproducible demonstration.
Codex accelerated source investigation, parser and test implementation, compatibility analysis, caching, the historical API, packaging, and release validation. The user set the scope and methodology: infrastructure before a dashboard, one deeply verified dataset, strict contracts instead of silent adaptation, explicit vintage handling, and bounded 16 GB local execution. The primary model used for this work was GPT-5.6 Sol with extra-high reasoning.
Judge quick start
Install the exact released wheel rather than a package with the same name from another index:
python -m venv .venv
source .venv/bin/activate
python -m pip install "https://github.com/fotogfreaksandeep-arch/IndiaMacro/releases/download/v0.2.0/indiamacro-0.2.0-py3-none-any.whl"
Then run:
from indiamacro import rbi
history = rbi.sectoral_credit_history(
start_issue="2025-07",
end_issue="2026-06",
)
points = history.select(
series_id="RBI.SECTION42.NON_FOOD_CREDIT.OUTSTANDING",
view="current",
)
print(len(history.vintages), len(history.current_observations), len(points))
The first live run requires access to public RBI pages and populates a
validated cache. Subsequent runs can replay the same source material without a
network session by passing offline=True.
Install v0.2.0
Version 0.2.0 has not been published to PyPI. Install the exact wheel from the public GitHub release:
IndiaMacro supports Python 3.11 and 3.12. Its portable CI suite runs on Ubuntu,
and the release demonstration has also been validated on macOS Apple silicon.
The released wheel is pure Python (py3-none-any) and has no platform-specific
compiled extension.
Create and activate an isolated environment on macOS or Linux:
python -m venv .venv
source .venv/bin/activate
On Windows PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
Then install the released wheel:
python -m pip install "https://github.com/fotogfreaksandeep-arch/IndiaMacro/releases/download/v0.2.0/indiamacro-0.2.0-py3-none-any.whl"
Matplotlib remains optional:
python -m pip install "indiamacro[plot] @ https://github.com/fotogfreaksandeep-arch/IndiaMacro/releases/download/v0.2.0/indiamacro-0.2.0-py3-none-any.whl"
Development installs from a source checkout remain available:
python -m pip install .
python -m pip install ".[plot]"
Do not use pip install indiamacro to judge v0.2.0: this version is distributed
through the GitHub release and has not been published to PyPI.
Test a source checkout
Install the development dependencies and run the portable validation layer:
python -m pip install -e ".[test,plot,build]"
ruff check .
pytest -m "not local_evidence and not live" -rs
python -m build
python -m twine check dist/*
The portable suite runs serially, makes no live RBI requests, and does not depend on ignored local evidence. Maintainers who have the preserved RBI acceptance evidence can additionally run:
pytest -m local_evidence -rs
Live RBI acceptance remains explicitly opt-in and is excluded from ordinary tests and CI:
pytest -m live -rs
See Testing IndiaMacro for the purpose and evidence requirements of each test layer.
Retrieve current data
from indiamacro import rbi
credit = rbi.sectoral_credit()
print(credit.observations.head())
print(credit.metadata.latest_observation_date)
print(credit.metadata.freshness_status)
print(credit.metadata.semantic_observations_sha256)
The result exposes a long-form pandas DataFrame as credit.observations, typed
release and provenance metadata as credit.metadata, and the two complete RBI
methodology notes as credit.notes.
The Bulletin can lag RBI's dedicated monthly Sectoral Deployment release.
latest_observation_date is the latest date represented by the returned data,
while freshness_status reports the comparison with the dedicated release
index. IndiaMacro never requests the dedicated release's blocked XLSX file.
Verified publication history
The historical connector covers the 12 verified RBI Bulletin issues from July 2025 through June 2026, inclusively:
from indiamacro import rbi
history = rbi.sectoral_credit_history(
start_issue="2025-07",
end_issue="2026-06",
)
vintages = history.vintages
current = history.current_observations
non_food = history.select(
series_id="RBI.SECTION42.NON_FOOD_CREDIT.OUTSTANDING",
view="current",
)
non_food_yoy = history.select(
series_id="RBI.SECTION42.NON_FOOD_CREDIT.YOY_GROWTH_REPORTED",
view="current",
)
resolved = history.resolve(policy="latest_publication", as_of="2026-04-30")
Historical collections are immutable tuples of frozen records with Decimal
values; selection and resolution do not return pandas objects. The complete
range contains 5,950 published-vintage observations and 3,060 current
observations. Each Non-food Credit selection above yields 12 chart-ready
points. The January-to-February 2026 boundary changes the current-date basis
from the last reporting Friday to calendar month-end, so a continuous
publication sequence does not imply unchanged methodology.
See the historical API guide for cache, offline replay, hash, resolution, and exception details.
Plotting is an optional downstream demonstration:
python -m pip install ".[plot]"
python scripts/plot_rbi_sectoral_credit_history.py --offline
The end-to-end tutorial walks through live retrieval, offline replay, selection, explicit resolution, CSV export, chart generation, and provenance inspection. IndiaMacro's core purpose remains auditable data access; the chart demonstrates what trustworthy downstream applications can build on that infrastructure.
Refresh, offline use, and cache
# Prefer a verified cache; retrieve live only when no compatible bundle exists.
credit = rbi.sectoral_credit()
# Force exact-title live discovery and bounded retrieval.
credit = rbi.sectoral_credit(refresh=True)
# Guarantee no network session is created.
credit = rbi.sectoral_credit(offline=True)
# Replay verified historical issues from their separate history cache.
history = rbi.sectoral_credit_history(
"2025-07",
"2026-06",
offline=True,
)
An explicit cache_dir may be passed to any call. Otherwise
INDIAMACRO_CACHE_DIR is used when set, followed by the platform-standard user
cache directory. Raw HTML pages and a versioned manifest are committed only
after both tables validate and parse. Every cache read recalculates raw and
output hashes. Missing, incompatible, or corrupt caches raise specific errors;
the API never returns an empty DataFrame as an error substitute.
Pre-release manifest schema 1 bundles used the misleading field
normalized_output_sha256. v0.1.0 classifies those bundles as incompatible.
Run an online call to create a schema 2 bundle, or remove the obsolete bundle.
Immutable old bundles are not rewritten.
Data and provenance identities
IndiaMacro distinguishes three hash concepts:
major_sectors_sha256andindustries_sha256identify the exact raw HTML bytes. RBI page-chrome changes therefore change these hashes.semantic_observations_sha256identifies sorted normalized economic data and classifications, excluding transport and implementation provenance. It remains stable across page-chrome, source-URL, DataFrame-index, and row-order changes.provenance_bound_output_sha256identifies the complete canonical output, including source URLs, raw source hashes, parser version, and layout ID. It changes when either the economic data or provenance changes.
The exact columns and serialization rules are documented in
docs/contracts/rbi_sectoral_credit_bulletin_v1.md.
Vintages and explicit resolution
history.vintages retains every published value and reference observation;
repeated publications and later revisions remain separate. The
history.current_observations view contains each release's current outstanding
value and RBI-reported growth measures. Neither collection silently chooses a
latest value.
Use history.resolve(policy="latest_publication") when a resolved view is
explicitly required. Its optional as_of="YYYY-MM-DD" cutoff excludes later
publications while retaining the selected publication and provenance.
Current limitations
The current connector supports its strict v1 layout. Historical support begins with the July 2025 Bulletin and ends with the June 2026 Bulletin. Those are verified support boundaries, not the full availability of sectoral-credit data from RBI. IndiaMacro does not yet provide other RBI datasets, DBIE integration, automatic future-layout adaptation, dashboards, forecasting, or a general Indian macro-data platform. Version 0.2.0 is not yet published to PyPI.
IndiaMacro is licensed under the MIT License.
Analysis
View
Metric
- 9
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- HTMLIn code
- PythonIn code
2 of 2 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
609 KB
Source files
44
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
fotogfreaksandeep-arch/IndiaMacro
51 files · 712 KB · @ 922b4f5
Structure
Application logic
10 files · 20%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python81%
- Markdown17%
- HTML2%
- YAML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
pyproject.toml
pypi · 8- pandas
- platformdirs
- requests
- +5 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.