中国节假日
判断某年某月某一天是不是工作日/节假日。 目前支持 2016 年至 2018年。 兼容 Python2 与 Python3.
安装
pip install chinesecalendar
样例
import datetime
# 判断 2018年4月30号 是不是节假日
from chinese_calendar import is_workday, is_holiday
april_last = datetime.date(2018, 4, 30)
self.assertFalse(is_workday(april_last))
self.assertTrue(is_holiday(april_last))
# 或者在判断的同时,获取节日名
import chinese_calendar as calendar # 也可以这样 import
on_holiday, holiday_name = calendar.get_holiday_detail(april_last)
self.assertTrue(on_holiday)
self.assertEqual(calendar.Holiday.labour_day.value, holiday_name)
Metadata
Release files for chinesecalendar 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chinesecalendar-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for chinesecalendar-0.1.0-py3-none-any.whl |
| chinesecalendar-0.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for chinesecalendar-0.1.0-py2.py3-none-any.whl |
Total release size: 8.1 kB
Release files / chinesecalendar-0.1.0-py3-none-any.whl
| Download URL | chinesecalendar-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60a1903d140dc004bcea65542fa5f0c444fa77ade7677e8cbd9625ebffe4d012
|
|
BLAKE2b-256 checksum How to use checksums |
a0cc99e1e473b31db928108c3a8d51c0185c6043309260ab1ddf0ea01a54f714
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / chinesecalendar-0.1.0-py2.py3-none-any.whl
| Download URL | chinesecalendar-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b3f9929ba34759949f47442cfe17a667286ca93420663782405792a8d283a86d
|
|
BLAKE2b-256 checksum How to use checksums |
87cf74716f7da99c87736aef55509b255bda8675114898b5a89f4ba620a7a34e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for chinesecalendar 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.