Skip to main content

查询某天是否放假

Project description

CNHoliday: 查询某天是否放假

数据来源:

年份 出处
2019 国务院办公厅关于 2019 年部分节假日安排的通知
2020 国务院办公厅关于 2020 年部分节假日安排的通知
2021 国务院办公厅关于 2021 年部分节假日安排的通知

安装:

# 不依赖第三方包库
pip install cnholiday

用法:

>>> from datetime import datetime
>>>
>>> from cnholiday import CNHoliday
>>>
>>>
>>> cnholiday = CNHoliday()
>>> _day = datetime(2019, 10, 1)
>>> print(cnholiday.check(_day))
True
>>> print(cnholiday.check_shift(_day))
True
>>> print(cnholiday.check_shift(_day, shift=2))
True
>>> print(cnholiday.check_shift(_day, shift=3))
True

相关项目:

Project details


Download files

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

Files for cnholiday, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size cnholiday-0.2.0-py3-none-any.whl (3.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size cnholiday-0.2.0.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page