Skip to main content

check if some day is holiday in China

Project description

Package Travis License README

判断某年某月某一天是不是工作日/节假日。 目前支持 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)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

chinesecalendar-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

chinesecalendar-0.1.0-py2.py3-none-any.whl (4.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file chinesecalendar-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chinesecalendar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60a1903d140dc004bcea65542fa5f0c444fa77ade7677e8cbd9625ebffe4d012
MD5 e3767e5d2fdbaf28db7d5283db4b8644
BLAKE2b-256 a0cc99e1e473b31db928108c3a8d51c0185c6043309260ab1ddf0ea01a54f714

See more details on using hashes here.

File details

Details for the file chinesecalendar-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for chinesecalendar-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b3f9929ba34759949f47442cfe17a667286ca93420663782405792a8d283a86d
MD5 b6f74629167b10fe3e8b581b3bb48073
BLAKE2b-256 87cf74716f7da99c87736aef55509b255bda8675114898b5a89f4ba620a7a34e

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