Skip to main content

交易日历

Project description

Trading Calendars(tcalendars)

交易日历,用于交易时间的判断。当前支持的市场有:

  • 中国股票市场(2005年1月1日起)

安装

pip install tcalendars

示例

from tcalendars import TradingCalendars

calendar = TradingCalendars()
# 判断2023年1月1日是否为交易日
calendar.is_trading_day('2023-01-01')
# 输出:False

# 获取2023年1月1日至2023年1月5日的所有交易日
calendar.get_trading_days('2023-01-01', '2023-01-05')
# 输出:['2023-01-03', '2023-01-04', '2023-01-05']

# 获取2023年1月1日所在的交易日,如果1月1日不是交易日,则返回后一个交易日
calendar.get_trading_day('2023-01-01')
# 输出:'2023-01-03'

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

tcalendars-1.0.1.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

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

tcalendars-1.0.1-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file tcalendars-1.0.1.tar.gz.

File metadata

  • Download URL: tcalendars-1.0.1.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for tcalendars-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e4320e169fe3836eb4adeb9be8ee68ec517c307c227c92bd486c7f32af6bc55f
MD5 ad937a54ef3985b246339affae78fab1
BLAKE2b-256 0cf93dfc211a96f76a71e6e40f6a2d25aab792cee9f03920da1924508dd78769

See more details on using hashes here.

File details

Details for the file tcalendars-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: tcalendars-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for tcalendars-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a74288105930160e59a2710c9f41011ff72d09009a3642c63f0757ce8e89d534
MD5 cb3bf1562c2c7b2a85c5b36fe4a9b93b
BLAKE2b-256 769a52a1683ed8244d35fdadedec8482e39278ede1a3353e7b03d9b4d0af4105

See more details on using hashes here.

Supported by

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