Python market calendar API for NSE, BSE, and MCX built for Indian trading systems, Indian market holidays, market-open checks, and intraday execution.
Project description
aion-indian-market-calendar
Python market calendar API for NSE, BSE, and MCX — built for Indian trading systems and intraday execution.
aion-indian-market-calendar is an nse trading calendar python package, an indian stock market calendar python library, and a market calendar api india option for developers who need correct sessions, trading holidays, and is market open today india python checks. It is built for intraday trading calendar india and algo trading market timings nse use cases where execution engines must know whether the market is actually open before placing orders.
Works as a market calendar api python layer for NSE, BSE, and MCX, including trading hours api india and stock market calendar api india use cases for quantitative finance, algo trading, and broker-side pre-trade validation.
Includes macro-event awareness for RBI, Budget, FOMC, and exchange schedule changes.
If you tried pandas_market_calendars india, pandas_market_calendars nse, or pandas_market_calendars mcx and ran into incorrect holidays or missing commodity sessions, this is the alternative to pandas_market_calendars india that fixes those gaps.
Works for:
- NSE trading calendar python
- MCX trading hours python
- Indian stock market holidays API
- is market open today India
- intraday / algo trading systems needing correct market timings
- alternative to pandas_market_calendars for India
Structure
aion_indian_market_calendar/
├── __init__.py
├── calendar.py
├── models.py
├── data/
│ └── events_2026.json
├── tests/
│ ├── conftest.py
│ └── test_calendar.py
├── pyproject.toml
└── README.md
Quick Start
Simple Python API, no external services required. Use it for prevent trades outside market hours python, trading bot market hours india, and nse trading hours for bot checks before execution.
Is the market open right now?
from aion_indian_market_calendar import is_market_open
is_market_open("NSE") # True / False for "is nse open today"
is_market_open("MCX") # Handles mcx evening session python cases correctly
Used in intraday trading and algo trading systems to prevent execution during closed sessions. This directly answers is stock market open today india python and check market status nse python use cases.
Next trading day
from aion_indian_market_calendar import next_trading_day
next_trading_day("NSE")
Full calendar API
from datetime import datetime
from zoneinfo import ZoneInfo
from aion_indian_market_calendar import IndiaMarketCalendar
cal = IndiaMarketCalendar.bundled(2026)
ist = ZoneInfo("Asia/Kolkata")
now = datetime.now(ist)
# Check if NSE equity is trading right now
print("NSE open?", cal.is_market_open(now, "NSE_EQUITY"))
# Get today's exact trading session (accounts for partial MCX days)
session = cal.get_session(now, "MCX")
for seg in session or []:
print(f"MCX: {seg.open} - {seg.close}")
# List all NSE equity holidays for 2026
for d in cal.holidays("NSE_EQUITY", 2026):
print(d)
Designed for trading systems, bots, and execution engines that require accurate Indian market timings. This is a python library for indian stock market calendar, how to handle trading holidays in india python, and market session timing nse mcx python package rather than a generic U.S.-centric calendar wrapper.
Why This Exists
Most calendar libraries do not model Indian exchanges deeply enough. Common pain points include:
pandas market calendar nse incorrect holidaysfix pandas_market_calendars india holidays- no usable
mcx holiday calendar python - missing
mcx market open time indiaandmcx trading hours today - no clean answer to
how to check if market is open before placing trade python
Why Developers Choose aion-indian-market-calendar
- Save weeks of engineering: no need to scrape NSE circulars, parse Hindu calendars, or model
mcx commodity market calendaredge cases - Production-ready: verified against official exchange calendars and tested for known edge cases
- Live delta updates: refresh from a remote URL, no
pip install --upgradeneeded for every holiday change - LLM-friendly: static JSON and live endpoint are machine-readable, so coding assistants can query or embed the package
- Better commodity support: includes
mcx evening session pythonbehavior andmcx trading hours pythonsession overrides that most alternatives miss
Features
nse trading calendar pythoncoverage for cash, equity derivatives, currency, interest rate derivatives, and corporate bondsindian market holidays pythoncoverage with bundled static data and live delta overridesmcx commodity market calendarsupport including evening-only trading days and special morning/evening session handlingmarket calendar api indiaergonomics withis_market_open(...),next_trading_day(...), and per-segment session inspectionintraday trading calendar indiasupport for execution engines that must block orders outside exchange hours
Companion Usage
This package is standalone. It can be used with any broker or strategy engine, including:
- risk checks before order placement
- backtesting systems that need correct Indian market sessions
- signal validators that need to know whether NSE or MCX was tradable at a given timestamp
Live Refresh
calendar = IndiaMarketCalendar.bundled(
2026,
refresh_url="https://<username>.github.io/<repo>/live_events.json",
refresh_interval_hours=4,
)
calendar.refresh()
- live deltas are cached at
~/.aion_indian_market/live_cache.json - bundled static events remain the fallback
- live events override bundled events by
id deleted_idscan remove bundled events without repackaging the wheel
Delta Format
{
"version": "20260430-001",
"generated_at": "2026-04-30T10:00:00+05:30",
"events": [],
"deleted_ids": []
}
Notes
data/events_2026.jsoncan be either:- a plain list of event objects, or
- an object with top-level metadata plus an
eventslist
- main typed models:
MarketEventEventPolicySessionSegment
- bundled metadata also exposes:
calendar.sourcescalendar.market_timingscalendar.default_sessions
- convenience helpers:
is_market_open(market="NSE", at=None, year=2026)next_trading_day(market="NSE", after=None, year=2026)
- live refresh metadata exposes:
calendar.refresh_urlcalendar.refresh_interval
- bundled 2026 segment calendars now include:
NSE_EQUITYNSE_EQUITY_DERIVATIVESNSE_CURRENCY_DERIVATIVESNSE_COMMODITY_DERIVATIVESNSE_INTEREST_RATE_DERIVATIVESNSE_CORPORATE_BONDSMCX
EventCalendarremains available as a compatibility alias forIndiaMarketCalendar- the current bundled data is copied from:
src/shared_core/risk/special_events_and_holidays.jsonand extended with:https://nsearchives.nseindia.com/content/RSS/Circulars.xmlhttps://www.nseindia.com/resources/exchange-communication-holidayshttps://www.mcxindia.com/market-operations/trading-survelliance/trading-holidays
- repo-side helpers for live updates:
scripts/poll_nse_rss.py.github/workflows/update_live_events.yml.github/workflows/publish_live_events.yml
More Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aion_indian_market_calendar-0.1.0.tar.gz.
File metadata
- Download URL: aion_indian_market_calendar-0.1.0.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9290fb9fe78ac3999338edca01dc3feb5e32c690b6c6ae51a94489ae889f69e2
|
|
| MD5 |
aa94fc7132e0534d60b0695d99193151
|
|
| BLAKE2b-256 |
8963d8b347f065fd6f4ac725147ae719bc28b0e130cd70e0c934086cb9f56c3f
|
File details
Details for the file aion_indian_market_calendar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aion_indian_market_calendar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a11af4e85d606cdb188196f76168b5c54a30a293202cbe4f88d0f98ad0cddfe
|
|
| MD5 |
bd7bf3bd651ac628c40aeb3071f980ce
|
|
| BLAKE2b-256 |
b0db34b949b7fb035084b1f1316516760c1964bb0fbe41fc1fa2942eb25eec8f
|