Skip to main content

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

Indian stock market calendar API for Python — NSE trading calendar, MCX trading hours, and market timings for trading bots.

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.

Acts as a market-timing layer for trading APIs and execution systems in India.

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

Used in:

  • trading bots (Zerodha, Angel One, Upstox)
  • intraday and algo trading systems
  • automation workflows (n8n, Zapier, Python scripts)
  • APIs that need accurate NSE/BSE/MCX market timings

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.

Useful for:

  • NSE API integrations
  • trading bot development India
  • market hours validation before order 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 holidays
  • fix pandas_market_calendars india holidays
  • no usable mcx holiday calendar python
  • missing mcx market open time india and mcx 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 calendar edge 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 --upgrade needed 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 python behavior and mcx trading hours python session overrides that most alternatives miss

Features

  • nse trading calendar python coverage for cash, equity derivatives, currency, interest rate derivatives, and corporate bonds
  • indian market holidays python coverage with bundled static data and live delta overrides
  • mcx commodity market calendar support including evening-only trading days and special morning/evening session handling
  • market calendar api india ergonomics with is_market_open(...), next_trading_day(...), and per-segment session inspection
  • intraday trading calendar india support 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_ids can 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.json can be either:
    • a plain list of event objects, or
    • an object with top-level metadata plus an events list
  • main typed models:
    • MarketEvent
    • EventPolicy
    • SessionSegment
  • bundled metadata also exposes:
    • calendar.sources
    • calendar.market_timings
    • calendar.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_url
    • calendar.refresh_interval
  • bundled 2026 segment calendars now include:
    • NSE_EQUITY
    • NSE_EQUITY_DERIVATIVES
    • NSE_CURRENCY_DERIVATIVES
    • NSE_COMMODITY_DERIVATIVES
    • NSE_INTEREST_RATE_DERIVATIVES
    • NSE_CORPORATE_BONDS
    • MCX
  • EventCalendar remains available as a compatibility alias for IndiaMarketCalendar
  • the current bundled data is copied from:
    • src/shared_core/risk/special_events_and_holidays.json and extended with:
    • https://nsearchives.nseindia.com/content/RSS/Circulars.xml
    • https://www.nseindia.com/resources/exchange-communication-holidays
    • https://www.mcxindia.com/market-operations/trading-survelliance/trading-holidays
  • repo-side helpers for live updates:
    • scripts/poll_nse_rss.py
    • docs/workflow_templates/update_live_events.yml
    • docs/workflow_templates/publish_live_events.yml

More Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aion_indian_market_calendar-0.1.1.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aion_indian_market_calendar-0.1.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file aion_indian_market_calendar-0.1.1.tar.gz.

File metadata

File hashes

Hashes for aion_indian_market_calendar-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0dfa4bdead9126bc9338c5dc863783f99a9f05beb16e7dd22f678b09b3c651f5
MD5 f64efc1ad37a224a25e3eb821df3fdb7
BLAKE2b-256 e950f7ef695cd1878ec50c1d669caeb6cbb7a905ab97c34f4a0fb864202e356a

See more details on using hashes here.

File details

Details for the file aion_indian_market_calendar-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aion_indian_market_calendar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e71d6a2711c9a7919a301d1a9c9eaba0051336ab25142a910663cea57bf26ce
MD5 348bc278bfb7aa7bab062441f01f2d92
BLAKE2b-256 80d590c8e5a32ff4f0b4b9fc25d9b90a48ddd0f8ff045ab5efe550916529da3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page