skillfed

pandas_market_calendars

Market and exchange trading calendars for pandas

pandas-market-calendars v5.4.0 2.1M downloads/30d#3,297 on PyPI990
Permissive license MIT Active released

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-calendars

uv

uv add pandas-market-calendars

poetry

poetry add pandas-market-calendars

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development

Tags

trading calendar pandasmarket hours exchange calendarbusiness day trading scheduleglobal exchange holidaysfutures market calendarOTC market hoursdate range market open close
trading-financetime-seriesmarket-data

More Software Development packages