# exchange_calendars

Sessions, minutes and holidays for 69 exchanges, keyed by ISO-10383 code.

*https://stockmarketstack.com/tools/exchange-calendars · Market Analysis & Portfolio Optimization Libraries*

## Facts

### At a glance

| Field | Value |
| --- | --- |
| Vendor | Gerry Manoim |
| Category | Market Analysis & Portfolio Optimization Libraries |
| Job | market_calendars |
| Website | https://github.com/gerrymanoim/exchange_calendars |
| Pricing model | open-source |
| Free tier | true |
| Open source | true |
| Licence | Apache-2.0 |
| Self-hosted | true |
| Tested hands-on | false |
| Last updated | 2026-09-19 |

### Coverage

| Field | Value |
| --- | --- |
| Asset classes | stocks, futures |
| Markets | global |
| Works outside the US | true |
| Data latency | none |
| Platforms | library, cli |
| AI features | none |

### Interfaces

| Field | Value |
| --- | --- |
| API | false |
| Webhooks | false |
| Scripting | Python |
| Python | true |
| Spreadsheet add-in | false |
| MCP server | false |
| Export | none |

### Capabilities

Yes: none

No: charting, screening, scanning, backtesting, automation, live_trading, paper_trading, portfolio_tracking, broker_import, tax_reporting, alerts, news, options_analysis

*Verified: pricing 2026-09-19; capabilities 2026-09-19; coverage 2026-09-19.*

## What it is

`xcals.get_calendar("XNYS")` returns a calendar object, and everything follows from that. The
`schedule` property is a DataFrame indexed by session with `open`, `break_start`, `break_end` and
`close` columns in UTC, so a Hong Kong lunch break or a US half-day before Independence Day is
data rather than a special case you code around. On top of it sit session helpers
(`is_session`, `sessions_in_range`, `sessions_window`, `previous_session`, `date_to_session`),
minute helpers (`session_minutes`, `is_trading_minute`, `is_break_minute`, `previous_minute`) and
`trading_index`, which builds a period index that skips everything the exchange was closed for.

Calendars are named by their ISO-10383 market identifier code — XNYS, XLON, XTKS, CMES — and the
README table lists 69 of them, from the New York Stock Exchange in version 1.0 to Dubai Financial
Market on `master` today. There is also a command-line entry point — `ecal XNYS 2020` prints a
unix-cal style year with the holidays in brackets.

## Pricing

Free, Apache-2.0, nothing to buy. `pip install exchange_calendars`, with pandas, numpy, toolz,
tzdata, pyluach and korean_lunar_calendar behind it — the last two because Israeli and Korean
holidays are not solvable with a Gregorian rule.

## Data & coverage

69 exchange calendars covering the Americas, Europe, Asia, the Middle East, Africa and
Australasia, mostly equity venues plus a handful of derivative and energy ones — CME, CBOE
Futures, ICE US, Eurex and the European Energy Exchange. Sessions, lunch breaks, early closes and
one-off interruptions are all modelled; an exchange counts as open only during regular trading,
so pre-market, post-market and auction periods read as closed.

The calendars are package code, not a feed. Nothing is requested from a server at runtime, which
means a corrected holiday reaches you by upgrading the package — and, when the release cadence
slows down, by installing from git.

## Integrations

[Zipline-reloaded](https://stockmarketstack.com/tools/zipline-reloaded) takes these codes directly through its
`--trading-calendar` flag. `pandas_market_calendars` mirrors the whole set and depends on this
package; `market_prices`, by the same maintainer who does most of the work here, is built on it.

## Limitations

- Every calendar is contributed by users. The README says so plainly — if a holiday is wrong,
  the fix is a pull request you write. How accurate a given exchange is depends on who last cared
  about it.
- Releases lag the fixes. The last PyPI release is 4.13.2 from 10 March 2026, while `master` has
  carried the Dubai calendar since 14 August 2026 and Hong Kong weather closures since
  15 September 2026. Six months of calendar corrections currently exist only in git.
- The default schedule window is twenty years back and one year forward, and future sessions are
  rule-generated rather than confirmed against an exchange notice.
- Versions 4.0 and 4.3 renamed or removed several dozen methods, and the README carries a long
  deprecation table. Code written against `trading_calendars` or early exchange_calendars will
  need edits.
- PyPI classifies it Development Status :: 4 - Beta.
- No intraday auction, settlement or holiday-reason metadata — you get open and closed, not why.

## Alternatives

`pandas_market_calendars` wraps the same calendars in a `schedule()` and `date_range()` API and
adds futures-product conventions of its own, at the cost of a second layer to keep current. If
all you need is US equity sessions, a market data API that already returns bars on an exchange
calendar — see [market data APIs](https://stockmarketstack.com/categories/market-data-apis) — removes the question.

## FAQ

### Is exchange_calendars maintained?

The code is, the releases less so. Commits land most weeks — the newest on `master` is 15 September 2026 — but the last PyPI release, 4.13.2, went out on 10 March 2026. Gerry Manoim owns the repository and Marcus Read does most of the current work; 21 issues and 7 pull requests are open and nothing is archived.

### Where did it come from?

Quantopian's `trading_calendars`, which stopped at version 2.1.1 on 5 January 2021 and saw its last commit on 20 January 2021. exchange_calendars is the continuation and kept the Apache-2.0 licence; the calendar codes are the same, which is why Zipline-reloaded's `--trading-calendar` flag still takes them.

### How far into the future do the calendars go?

One year by default, and twenty years back — `GLOBAL_DEFAULT_START` and `GLOBAL_DEFAULT_END` in the source. You can ask for a wider range, but only within the bounds each individual calendar declares, and future holidays are generated from rules rather than from an exchange's published notice.

### Is pandas_market_calendars the same thing?

No, it is a separate package by a different author — Ryan Sheftel, MIT-licensed — with its own `schedule()` and `date_range()` API. Since its version 2.0 it mirrors these calendars and lists `exchange-calendars` as a dependency, so choosing it does not mean leaving this project behind; it means adding a layer on top of it.

## Also worth comparing

- [pandas-ta](https://stockmarketstack.com/tools/pandas-ta.md) — The DataFrame indicator library whose repo is gone and whose last release is a year old.
- [QuantLib](https://stockmarketstack.com/tools/quantlib.md) — The open-source derivatives pricing library banks actually use, reachable from Python.
- [TA-Lib](https://stockmarketstack.com/tools/ta-lib.md) — The C indicator library everything else wraps — and pip now ships the C part with it.
- [arch](https://stockmarketstack.com/tools/arch.md) — GARCH and the rest of the volatility-model family, plus the tests you need around them.
- [empyrical-reloaded](https://stockmarketstack.com/tools/empyrical-reloaded.md) — The maintained fork of Quantopian's empyrical — risk statistics, no plots.
- [ffn](https://stockmarketstack.com/tools/ffn.md) — Performance stats, drawdowns and portfolio weights from a DataFrame of prices.
