check if some day is holiday in Japan
Project description
🇯🇵日本节假日
判断某年某月某一天是不是工作日/节假日。 支持 2023~2024年
安装
pip install japanesecalendar
升级
pip install -U japanesecalendar
日本的公众假期无调休,有补假,假期预测相比较很容易
样例
import datetime
# 判断 2023年1月1号 是不是节假日
from japanese_calendar import is_holiday, is_workday
new_year = datetime.date(2023, 1, 1)
assert is_workday(new_year) is False
assert is_holiday(new_year) is True
# 或者在判断的同时,获取节日名
import japanese_calendar as calendar # 也可以这样 import
on_holiday, holiday_name = calendar.get_holiday_detail(new_year)
assert on_holiday is True
assert holiday_name == calendar.Holiday.new_years_day.value
其它语言
假如你没法使用Python, 你也可以转译现成的常量文件来获取最全的节假日安排表。
贡献代码
致谢
本项目参考了LKI的chinese-calendar,感谢开发者的付出
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
japanesecalendar-1.0.1.tar.gz
(12.5 kB
view details)
Built Distribution
File details
Details for the file japanesecalendar-1.0.1.tar.gz
.
File metadata
- Download URL: japanesecalendar-1.0.1.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbbbf009b17a190c5d3900d60bf345b17ed39bafd6a9d5875db5ec7e57d80708 |
|
MD5 | e0a07c5bc4530914bf1572787aa89651 |
|
BLAKE2b-256 | c5944ea201e3bc66e693f79647dbcffcbed801021a8307a11d8d289d988e403c |
File details
Details for the file japanesecalendar-1.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: japanesecalendar-1.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d26c21ce6a27c86ddf8125c5eb46ef539cfe07a7872c5c7b81678c06656e78d |
|
MD5 | 2773c3a49ef1177f47c5beda85c20d6d |
|
BLAKE2b-256 | c6578a7019482378450e6b353bef878d740dd30c24ca090d179736c854656393 |