Skip to main content
TradingHours API Docs

TradingHours.com Python Library

PyPI version Python versions GitHub Actions

Official Python library for TradingHours.com. Download market holidays and trading hours data locally for fast, offline access to 1,000+ exchanges worldwide.

About the Data

We support over 1,000 exchanges and trading venues around the world, including all major currencies. See all supported markets →

Data Coverage:

  • Market holidays and non-settlement dates
  • Trading hours with detailed phase information
  • Half-days and irregular schedules
  • Currency holidays for FX markets
  • Pre-trading, post-trading, and auction times

Data Quality:

Our global research team collects and verifies trading hours and market holidays using primary sources exclusively. Manual and automated checks ensure the highest degree of accuracy and reliability. Data updates occur daily.


Why Use the Python Library?

  • Blazing fast - No network latency, instant queries from local database
  • 🚫 No rate limits - Run unlimited queries without throttling
  • 💾 Offline access - Works completely offline after initial download
  • 🔧 Simple integration - Simple and user-friendly interface handles all complexity

View complete documentation →

Two Modes of Operation

📦 Package Mode

Use as a Python package

pip install tradinghours
tradinghours import
from tradinghours import Market
Market.get('US.NYSE')

Perfect for:

  • Python applications & scripts
  • Data analysis & backtesting
  • Trading algorithms

📖 Documentation →


🚀 Server Mode

Run as REST API server

pip install tradinghours[server]
tradinghours serve
>> curl http://127.0.0.1:8000/markets/US.NYSE
{"fin_id":"US.NYSE","exchange_name":"New York...

Perfect for:

  • Microservice and multi-language infrastructure
  • Low latency and no rate limits
  • Fully private and on-premise hosting

📖 Documentation →

Requirements

Alternative: Web API

Prefer not to install a Python library? Use our REST API, access the data on the Snowflake Marketplace, or get in touch with us for more information.

License

Commercial - See TradingHours.com for licensing details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tradinghours-0.6.2.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tradinghours-0.6.2-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file tradinghours-0.6.2.tar.gz.

File metadata

  • Download URL: tradinghours-0.6.2.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for tradinghours-0.6.2.tar.gz
Algorithm Hash digest
SHA256 a80d65eabf199176baeae8e87c6c610560299a07339d700ae17bf17643ff48e5
MD5 3eaf26769dd64130424617f77564eaca
BLAKE2b-256 3e603fff6bf22d4a6e422376556a379c18cd9fb14cd8b031d66ba1aba2a4ce24

See more details on using hashes here.

File details

Details for the file tradinghours-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: tradinghours-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for tradinghours-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be71d448fa9274a9bf79ce22c26bf4f4c08f06938f0a979c9730659b4c1efd90
MD5 275d39b79f17406814a0a3fe5dd7c07c
BLAKE2b-256 f4d6ee950dc46ad5aefd18c12164f306dfc439ac822b56a2218c8ee77dbf3548

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 files

0.6.1

2 files

0.6.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

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