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

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 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
    • .github/workflows/update_live_events.yml
    • .github/workflows/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.0.tar.gz (22.6 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.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for aion_indian_market_calendar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9290fb9fe78ac3999338edca01dc3feb5e32c690b6c6ae51a94489ae889f69e2
MD5 aa94fc7132e0534d60b0695d99193151
BLAKE2b-256 8963d8b347f065fd6f4ac725147ae719bc28b0e130cd70e0c934086cb9f56c3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aion_indian_market_calendar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a11af4e85d606cdb188196f76168b5c54a30a293202cbe4f88d0f98ad0cddfe
MD5 bd7bf3bd651ac628c40aeb3071f980ce
BLAKE2b-256 b0db34b949b7fb035084b1f1316516760c1964bb0fbe41fc1fa2942eb25eec8f

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