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.2.tar.gz
(12.3 kB
view details)
Built Distribution
File details
Details for the file japanesecalendar-1.0.2.tar.gz
.
File metadata
- Download URL: japanesecalendar-1.0.2.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21b1885bf9c8eb4bb83db8730aa97eccc5a2a32d54ea92a905014ea4ca07591c |
|
MD5 | 205bc42de84241025849dad80c6de8e1 |
|
BLAKE2b-256 | 9d5cb737f18125cf5ce703706965bc5cc82b753f9b79be8c7581cfb15207664a |
File details
Details for the file japanesecalendar-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: japanesecalendar-1.0.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe2030adaa8cc527bd2b8a5bc8cc21066cb50164efd2e0b7e8562662ca0bb11d |
|
MD5 | fea9ed287a8705a700830d679562969a |
|
BLAKE2b-256 | e7c99eeafaf0a03c245bc31d610333be963f565db0824b29c4bca4f294fe4633 |