Skip to main content

tradingcalendars

Python client for the TradingCalendars.com API: business days, T+N settlement dates and holidays for FX markets, currency clearing, bank holidays, payment systems (TARGET2, Fedwire, CHAPS…) and stock exchanges, including half days and early closes.

  • 50 currencies, 69 financial centres, 29 payment systems, 61 exchanges (coverage)
  • Maintained from official sources, past and future years
  • Standard library only, Python 3.9+
  • Installs as tradingcalendars-client, imports as tradingcalendars

Install

pip install tradingcalendars-client

Get a free API key (a minute, no card): https://tradingcalendars.com/signup?ref=pypi

Quick start

from tradingcalendars import TradingCalendars

tc = TradingCalendars(api_key="YOUR_API_KEY")   # or set TRADINGCALENDARS_API_KEY

# T+2 value date for a EUR/USD trade done on 23 December 2026
tc.add_business_days(["USD.FX", "EUR.FX"], "2026-12-23", 2)
# datetime.date(2026, 12, 28)  -> skips Christmas and the weekend

# Is a date open in several calendars at once?
tc.is_business_day(["TARGET2.PAY", "FEDWIRE.PAY"], "2026-12-28")   # True

# Business days between two dates (start counted, end not)
tc.business_days_between(["GBP.FX", "SGD.FX"], "2027-01-01", "2027-02-01")   # 20

# Holidays, with half days and early closes
for h in tc.holidays("XLON.TRADE", start="2026-12-01", end="2026-12-31"):
    print(h.date, h.event, h.early_close_time or "")
# 2026-12-24 Christmas Eve (half day) 12:30
# 2026-12-25 Christmas Day
# 2026-12-28 Boxing Day
# 2026-12-31 New Year's Eve (half day) 12:30

# Is the New York Stock Exchange open right now?
tc.market_status("XNYS")

Every *_details variant (add_business_days_details, is_business_day_details, business_days_between_details) returns the full answer, including each skipped day and why.

With pandas or numpy

import pandas as pd

closures = tc.closure_dates("XNYS.TRADE", start="2026-01-01", end="2027-12-31")
nyse_day = pd.offsets.CustomBusinessDay(holidays=closures)
pd.Timestamp("2026-11-25") + 2 * nyse_day   # skips Thanksgiving

Calendar codes

Family Code Example
FX market <ISO 4217>.FX USD.FX, EUR.FX
Currency non-clearing days <ISO 4217>.CLEAR USD.CLEAR
Bank holidays (financial centre) <UN/LOCODE>.BANK GBLON.BANK, USNYC.BANK
Payment systems <SYSTEM>.PAY TARGET2.PAY, FEDWIRE.PAY
Exchange trading <MIC>.TRADE XNYS.TRADE, XLON.TRADE
Exchange settlement <MIC>.SETTLE XNYS.SETTLE

tc.calendars() lists every code your plan covers. Browse them at tradingcalendars.com/coverage.

Errors

AuthenticationError (401/403), NotFoundError (404), RateLimitError (429, resets at midnight UTC) and TradingCalendarsError for anything else. Messages come from the API and say what to do next.

Also available

License

MIT. The data itself is provided under the TradingCalendars.com terms.

Metadata

Release files for tradingcalendars-client 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tradingcalendars-client 0.1.0
File Size Uploaded Provenance Actions
tradingcalendars_client-0.1.0.tar.gz 8.3 kB With provenance Details for tradingcalendars_client-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tradingcalendars-client 0.1.0
File Interpreter ABI Platform Actions
tradingcalendars_client-0.1.0-py3-none-any.whl Python 3 none any Details for tradingcalendars_client-0.1.0-py3-none-any.whl

Total release size: 16.2 kB

Release files / tradingcalendars_client-0.1.0.tar.gz

Download URL tradingcalendars_client-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6945367d122357c4065be5c95c69488de85abd6dfcca440b67fb546d28937ddf
BLAKE2b-256 checksum
How to use checksums
d93f547b6a95e785eab18ca8897d5465b158ede9808fd6b427a6759a1562319f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / tradingcalendars_client-0.1.0-py3-none-any.whl

Download URL tradingcalendars_client-0.1.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50671c1ef2c2e22a93659bb07eb36be8cfe9f756b672d3a3f3401c911f423846
BLAKE2b-256 checksum
How to use checksums
72e230f13b3960e07bc26978650c3f03b57991be5c78cd2df0f4d057f494d1f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for tradingcalendars-client 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tradingcalendars_client-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page