Skip to main content

TradingHours Library

Project description

tradinghours-client-banner

TradingHours.com Python Library

TradingHours.com licenses Market Holidays and Trading Hours data for over 900 exchanges and trading venues around the world. This package allows clients to easily integrate our market holidays and trading hours data into existing applications. Using this package, data is downloaded from the TradingHours.com service and is then available for local, offline use.

A paid subscription is required to use this package

Learn more »

About the Data

Market coverage

We supports over 900 exchanges and trading venues, including all major currencies. See all supported markets.

Our comprehensive data covers:

  • Market holidays
  • Trading hours
  • Half-days / Irregular schedules
  • Non-settlement dates
  • Currency holidays
  • Detailed trading phases

How is data collected?

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

Once data is collected, we then continually monitor for changes to ensure the data is always up-to-date. Data is updated daily.

Installation

pip install tradinghours

Configuration

export TRADINGHOURS_TOKEN=<your-token-goes-here>

Usage

Importing Data

python -m tradinghours.console status
python -m tradinghours.console import

List Markets

from tradinghours.market import Market

for market in Market.list_all():
    print(market)

Get Market

from tradinghours.market imort Market
from tradinghours.structure import FinId

fin_id = FinId(country='US', acronym='IEX')
market = Market.get_by_fin_id(fin_id)

Market Holidays

from tradinghours.market imort Market
from tradinghours.structure import FinId

fin_id = FinId(country='US', acronym='IEX')
market = Market.get_by_fin_id(fin_id)
for holiday in market.list_holidays("2023-06-01", "2023-12-31"):
    print(holiday)

Trading Hours

from tradinghours.market imort Market
from tradinghours.structure import FinId

fin_id = FinId(country='US', acronym='IEX')
market = Market.get_by_fin_id(fin_id)
for concrete_phase in market.generate_schedules(date(2023, 9, 1), date(2023, 9, 30)):
    print(concrete_phase)

List Currencies

from tradinghours.currency import Currency

for currency in Currency.list_all():
    print(currency)

Currency Holidays

from tradinghours.currency import Currency

currency = Currency.get('AUD')
for holiday in currency.list_holidays("2023-06-01", "2023-12-31"):
    print(currency)

Project 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.0.3.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

tradinghours-0.0.3-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tradinghours-0.0.3.tar.gz
Algorithm Hash digest
SHA256 fc8ef4048543ebc2bbca9db675fdadbf32eeedacdf98983e26a3fe0e01d57c20
MD5 231a5725b9a5d6907a34b1af3b824af1
BLAKE2b-256 046442b39b438409e2962ab96a7b660fc52064b5ffd434ae62eea8ef22aee441

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tradinghours-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e7f28c3de9e63864790a074f9e188876f25ed034cd73f1b621d4db4c76932deb
MD5 bcc42812ee0ba7f360f994a283e2a4f7
BLAKE2b-256 1ebed6022d9cab54c5d6c723e62bc490b56ab0014eec6f0c657f6e940e187e3f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page