Skip to main content

TradingHours Library

Project description

TradingHours API Docs

TradingHours.com Python Library

TradingHours.com licenses Market Holidays and Trading Hours data for over 900 exchanges and trading venues around the world. This library allows clients to easily integrate our market holidays and trading hours data into existing applications. This packages downlods all available data from TradingHours.com and then allows you to work with the data locally.

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>

If you have an active subscription, click here to get your API key.

Usage

Importing Data

You just need to run the following command to download and import official data. Remember that you need to have a valid TRADINGHOURS_TOKEN environment variable.

$ tradinghours import
Downloading..... (0.824s)
Ingesting.......................... (12.066s)

You can then check current data status with the following subcommand:

$ tradinghours status --extended
Collecting timestamps.... (0.213s)
TradingHours Data Status:
  Remote Timestamp:   Thu Oct 26 02:08:17 2023
  Local Timestamp:    Thu Oct 26 03:12:40 2023

Reading local data.... (0.426s)
Extended Information:
  Currencies count:   30
  Markets count:      1012

List Markets

from tradinghours.market import Market

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

Get Market

from tradinghours.market imort Market

# Get by either FinID or MIC
market = Market.get('US.IEX')
market = Market.get('IEXG')

Market Holidays

from tradinghours.market imort Market

market = Market.get('US.IEX')
for holiday in market.list_holidays("2023-06-01", "2023-12-31"):
    print(holiday)

Trading Hours

from tradinghours.market imort Market

market = Market.get('IEXG')
for concrete_phase in market.generate_schedules("2023-09-01", "2023-09-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.4.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

tradinghours-0.0.4-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tradinghours-0.0.4.tar.gz
Algorithm Hash digest
SHA256 546807365425c59e9185285aacf8cbd7050b93624962361427067eb590a42b4c
MD5 2ce00d81bcb762b729f27c82fe371760
BLAKE2b-256 a7cafe22ebb3e64bb65734201537a3156a32def17028d0fb70a155df82f3c0a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tradinghours-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 17061b569bcdafe0f84a4467e44247fec9e4719ec43484acf062c761396e7535
MD5 9bdb0dcbbec0fbd57d51ecc8786efe1b
BLAKE2b-256 ba7e455fbb9caffa987ed3ab587853ab316ab88b3c716da38486d3223c5d81ed

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