🇯🇵日本节假日
判断某年某月某一天是不是工作日/节假日。 支持 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,感谢开发者的付出
Metadata
Release files for japanesecalendar 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| japanesecalendar-1.0.2.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| japanesecalendar-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.5 kB
Release files / japanesecalendar-1.0.2.tar.gz
| Download URL | japanesecalendar-1.0.2.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21b1885bf9c8eb4bb83db8730aa97eccc5a2a32d54ea92a905014ea4ca07591c
|
|
BLAKE2b-256 checksum How to use checksums |
9d5cb737f18125cf5ce703706965bc5cc82b753f9b79be8c7581cfb15207664a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Release files / japanesecalendar-1.0.2-py3-none-any.whl
| Download URL | japanesecalendar-1.0.2-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe2030adaa8cc527bd2b8a5bc8cc21066cb50164efd2e0b7e8562662ca0bb11d
|
|
BLAKE2b-256 checksum How to use checksums |
e7c99eeafaf0a03c245bc31d610333be963f565db0824b29c4bca4f294fe4633
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|