Open Source · MIT License

AION Indian Market Calendar

A Python package that answers one question cleanly across every Indian exchange segment: is this market open right now, on this date, or at this time? Covers NSE, BSE, MCX, NSE Currency Derivatives (CDS), and Muhurat trading — including CDS-specific session windows and holiday calendars that differ from equity markets.

MIT License No API key required NSE · BSE · MCX · CDS Muhurat trading Market-times agnostic

total PyPI downloads
pip install aion-indian-market-calendar

Why this exists

Indian exchanges do not keep the same hours, and they do not share the same holiday calendar. NSE equity closes at 15:30. MCX commodity runs until 23:30. NSE Currency Derivatives (CDS) — the segment for USDINR, EURINR, GBPINR, and JPYINR — closes at 17:00 and observes holidays that sometimes differ from the equity segment on the same exchange.

Scripts that hardcode "NSE closes at 15:30 and is closed on NSE holidays" are wrong for CDS, wrong for MCX evening sessions, and silently wrong on days when one segment is closed but another is open. The typical fix is a scattered patch: a local holiday list, a hardcoded close time, a comment saying "update this every year." This package replaces all of that with one install.

No configuration file. No API key. No network dependency at runtime once installed. Works offline with bundled holiday and session data, updated with each package release.

CDS coverage — the differentiator

NSE Currency Derivatives is the segment most market calendar packages miss or get wrong. CDS covers currency futures and options: USDINR, EURINR, GBPINR, JPYINR.

CDS operates on its own schedule: 09:00 – 17:00 IST, 90 minutes longer than NSE equity. It also observes holidays that do not always coincide with NSE equity holidays — meaning a script that checks "is NSE open today?" can return the wrong answer for a CDS workflow.

This package is market-times agnostic: pass the segment key and it returns the correct session window and holiday calendar for that segment, not a one-size-fits-all equity answer.

SegmentSessionNote
NSE Equity09:00 – 15:30 IST
NSE F&O09:15 – 15:30 IST
NSE Currency Derivatives (CDS)09:00 – 17:00 ISTSeparate holiday calendar
BSE09:15 – 15:30 IST
MCX09:00 – 23:30 ISTTwo-segment day
MuhuratAnnual Diwali sessionDetected automatically

Quick usage

from aion_indian_market_calendar import IndiaMarketCalendar
from datetime import datetime
from zoneinfo import ZoneInfo

cal = IndiaMarketCalendar.bundled(year=2026)
tz  = ZoneInfo("Asia/Kolkata")
now = datetime.now(tz)

# Is NSE equity open right now?
cal.is_market_open("NSE", now)

# Is CDS (currency derivatives) open?
cal.is_market_open("NSE_CURRENCY_DERIVATIVES", now)
cal.is_market_open("CDS", now)          # alias works too

# Is MCX open on a specific date and time?
cal.is_market_open("MCX", datetime(2026, 1, 26, 10, 0, tzinfo=tz))  # False — Republic Day

# Is today a Muhurat trading session?
cal.is_trading_day(now, market="NSE")

# Get all NSE Currency Derivatives holidays for 2026
cal.holidays("NSE_CURRENCY_DERIVATIVES")

# Which instruments trade on CDS?
# USDINR, EURINR, GBPINR, JPYINR — pass the instrument name directly
cal.is_market_open("USDINR", now)       # resolves to NSE_CURRENCY_DERIVATIVES

Common use cases

  • Scheduling: skip weekends and segment-specific holidays in automated workflows
  • CDS workflows: gate currency derivative orders on the correct 09:00–17:00 window
  • Backtesting: generate valid trading day sequences per segment, not a shared equity calendar
  • MCX evening sessions: confirm commodity market is open after 15:30 when NSE is closed
  • Muhurat trading: detect the annual Diwali special equity session window
  • CI pipelines: gate data ingestion jobs per segment without hardcoding holiday lists

Package details

  • License: MIT — use freely in commercial and open-source projects
  • Python: 3.8 and above
  • Segments: NSE, NSE F&O, NSE Currency Derivatives, BSE, MCX, NSE Commodity Derivatives, Muhurat
  • Holiday data: bundled at install time, updated per release
  • No account: works immediately after pip install
  • No network at runtime: fully offline once installed

View on PyPI →

Verify the number yourself

curl -sS "https://pypistats.org/api/packages/aion-indian-market-calendar/overall" | python3 -m json.tool

The download counter above is sourced from /api/calendar/public-metrics (backed by PyPIStats, cached hourly). PyPI numbers count download events, not unique humans.

Links