pandas_market_calendars
Market and exchange trading calendars for pandas
What it is and what it does
pandas_market_calendars fills a gap in pandas by providing pre-built holiday, trading hours, and market break calendars for specific exchanges and OTC markets. Rather than fetching live data at runtime, calendars are shipped as package code and updated via new releases. The package wraps exchange-calendars to mirror its calendar definitions and adds utility functions to work with market schedules—most notably a date_range function that generates pandas DatetimeIndex objects containing only times when markets are open, accounting for holidays, early closes, and intraday breaks (such as lunch breaks in Asian markets or processing breaks in 24-hour futures markets).
Typical usage involves loading a calendar by exchange name (e.g., NYSE), querying its schedule for a date range to see market_open and market_close times, and then generating aligned datetime sequences for backtesting, data alignment, or trading logic. The package is designed for quantitative finance workflows where precise market hours and holiday handling are essential.
Use it for:
- Backtest trading strategies by generating datetime sequences aligned only to market hours for a specific exchange
- Align time series data to market open/close times when building multi-asset portfolios across different exchanges
- Identify market holidays and early closes programmatically to avoid scheduling trades or data pulls on non-trading days
- Handle intraday breaks in Asian and futures markets when calculating trading durations or generating periodic resampling
- Build global trading calendars by combining schedules from multiple exchanges to coordinate cross-market strategies
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides market and exchange trading calendars for pandas, including holiday, early close, and break schedules for over 50 global equity and futures markets.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a concrete problem for quantitative finance workflows. It is production-stable (Development Status 5), widely used (top 5000 PyPI), and permissively licensed. Install it if you need to work with market hours, holidays, or trading schedules in pandas.
Install
pandas-market-calendars on PyPI
pip
pip install pandas-market-calendarsuv
uv add pandas-market-calendarspoetry
poetry add pandas-market-calendarsInstalling pandas_market_calendars
Before you install
Low install friction with only two runtime dependencies (pandas and exchange-calendars). Active maintenance with a release 79 days ago and continuous repository activity; supports current Python versions (3.10–3.14).
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
pip install pandas_market_calendars
import pandas_market_calendars as mcal
nyse = mcal.get_calendar('NYSE')
schedule = nyse.schedule(start_date='2012-07-01', end_date='2012-07-10')
dates = mcal.date_range(schedule, frequency='1D')
Requires Python 3.10 or later; minimum version changed in v5.0 from 3.9.
Verify before relying
- Accuracy and timeliness of calendar data for all 50+ exchanges—whether updates keep pace with real-world market changes
- Performance characteristics when working with large date ranges or many calendars simultaneously
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — exchange-calendars, pandas |
| Maintenance | actively maintained — 79 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,099,085/month — #3,297 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pandas_market_calendars-5.4.0-py3-none-any.whl
Keywords: trading, exchanges, markets, OTC, datetime, holiday, business days
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
exchange_calendarsProvides trading calendars for more than 50…
permissive · top 5,000 on PyPI
workalendarWorkalendar provides holiday calendars and…
permissive · top 5,000 on PyPI
finlabBacktest trading strategies on Taiwan stock…
copyleft · top 15,000 on PyPI
efinanceFetches historical and real-time stock, fund,…
permissive · top 15,000 on PyPI
tradingview-screenerQuery TradingView's screener API to retrieve…
permissive · top 15,000 on PyPI
businesstimedeltaCalculates elapsed working time between two…
permissive · top 5,000 on PyPI
chinese-calendarDetermines whether a specific date in China is…
permissive · top 15,000 on PyPI
workadaysCalculates working days, calendar days, and…
permissive · top 15,000 on PyPI
alpaca-trade-apiPython client library for the Alpaca Commission…
unclear · top 15,000 on PyPI
tradingeconomicsProvides Python access to over 300,000 economic…
permissive · top 15,000 on PyPI