TradeBot Check
Trading involves a risk of losing money. Nothing on this site is financial advice and past results do not guarantee future results. Risk disclosure
Market data

exchange_calendars

Python library with trading calendars for more than 50 exchanges, so your code knows which days are sessions, when markets open, close and take breaks.

gerrymanoim/exchange_calendars★ 698 stars last commit 2026-12-01
Our take

Stop guessing market holidays: ask the calendar if a day is a session and when it opens and closes before your bot or backtest runs.

Who it is for

Python users who schedule bots, backtests or data downloads and need to skip non-trading days and respect opening hours.

Strengths

  • Over 50 exchanges, identified by ISO 10383 market codes such as XNYS.
  • Check whether a date is a session, list sessions in a range and find the previous or nearest one.
  • Schedule table with open, break start, break end and close for each session.
  • Trading minutes and custom intervals, for example splitting a session into 90-minute blocks.
  • Installs with pip, plus an ecal command to print a calendar for an exchange and year.

Good to know

  • Calendars are maintained through user contributions: missing holidays or wrong times are fixed by contributing updates, so double-check important dates.
  • Trading minutes exclude pre-trading, post-trading, auction periods and lunch breaks.
  • Several methods were renamed, deprecated or removed (for example sessions_opens and sessions_closes in 4.3), so check your version against the docs.
  • It is a calendar only; it has no price data, indicators or backtesting engine.

Custom bots are coming soon
We are preparing a service to build bots on tools like this one. Follow our Telegram channel to know when it opens.

Notify me

Real-life uses

Skip market holidays in your bot and backtest schedule

Ask an exchange calendar whether today is a trading session and when it opens and closes, so your script skips holidays and early shutdowns instead of failing or fetching empty data. Illustrative only, never a promise of returns.

🗓️ Tomorrow is a market holiday on this exchange (example). Data download and paper-trading run skipped; next session Monday 09:30.

Compare it with others

Guides that use it

Quick answers

How much does exchange_calendars cost?

Free and open source (Apache-2.0 per the GitHub repository). Prices change, so check the official website before you decide.

Is exchange_calendars open source?

Yes. License: Apache-2.0.

Who is exchange_calendars for?

Python users who schedule bots, backtests or data downloads and need to skip non-trading days and respect opening hours.

What is exchange_calendars written in?

exchange_calendars is written in Python.

What should I know before using exchange_calendars?

Calendars are maintained through user contributions: missing holidays or wrong times are fixed by contributing updates, so double-check important dates. Trading minutes exclude pre-trading, post-trading, auction periods and lunch breaks. Several methods were renamed, deprecated or removed (for example sessions_opens and sessions_closes in 4.3), so check your version against the docs. It is a calendar only; it has no price data, indicators or backtesting engine.

Want a bot like this when custom bots open? Get notified · All comparisons · Guides

Sources

Every fact on this page comes from these sources, checked on 2026-11-25. If something has changed, the source wins.

  1. https://github.com/gerrymanoim/exchange_calendars: 50+ exchanges, sessions, schedule, minutes, ecal command, pip install, Apache-2.0, caveats on minutes and renamed methods
  2. https://api.github.com/repos/gerrymanoim/exchange_calendars: Apache-2.0 license, about 690 stars, last push 2026-11-24, not archived

Alternatives in Market data