Skip to main content

获取中国法定节假日

Project description

get_holiday_cn

获取中国法定节假日

支持的python版本

python3.x

功能点

  1. 传入日期获取中国法定节假日

说明

依赖NateScarlet/holiday-cn

安装

pip install get_holiday_cn

数据说明

{
      "code": 0,              // 0服务正常。-1服务出错
      "type": {
        "type": enum(0, 1, 2, 3), // 节假日类型,分别表示 工作日、周末、节日、调休。
        "name": "周六",         // 节假日类型中文名,可能值为 周一 至 周日、假期的名字、某某调休。
        "week": enum(1 - 7)    // 一周中的第几天。值为 1 - 7,分别表示 周一 至 周日。
        "status": enum(0, 1)    // 数据场景类型,0来源于仓库中或者正常的上班日,数据可靠;1表示当前传入日期在仓库中未查询到,直接走系统计算,数据不可靠。
      },
      "holiday": {            // 只有当type为2,3时,该对象才存在
        "holiday": false,     // true表示是节假日,false表示是调休
        "name": "国庆节调休",  // 节假日的中文名。如果是调休,则是调休的中文名,例如'国庆节调休'
        "date": '2021-10-09'     // 当前请求的日期
      }
}

使用

from get_holiday_cn.client import getHoliday

client = getHoliday()
# 获取今日数据
print(client.assemble_holiday_data())
# 指定日期获取数据
print(client.assemble_holiday_data(today='2021-10-01'))

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

get_holiday_cn-1.0.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

get_holiday_cn-1.0.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file get_holiday_cn-1.0.3.tar.gz.

File metadata

  • Download URL: get_holiday_cn-1.0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for get_holiday_cn-1.0.3.tar.gz
Algorithm Hash digest
SHA256 ffde4ccdda7b401cadc2eb0bf39ff9c21870573347efe6d3e40084e1b896b321
MD5 1b38c9f736ebac9126fb7110112652a3
BLAKE2b-256 edae876c6d8b495ee8e14423cc2306ff226f1a55cfe73e90b1d1645b11182e5c

See more details on using hashes here.

File details

Details for the file get_holiday_cn-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: get_holiday_cn-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for get_holiday_cn-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5168a33060cdfa64440aa1cb9171d31011315b6387075d02ec0885e7df7fe78b
MD5 398d4e91f8cc8de37e062fb6bdf5e697
BLAKE2b-256 fffcd56e5c5ef170476cb48a05c9dcdf3a59652d99c30886a612f84c8a535c08

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