holiday_jp-python
Japanese holiday for Python 3+ using dataset from https://github.com/holiday-jp/holiday_jp
install
pip3 install holiday-jp
If you want to contribute
Build on linux with python 3.x
Clone the project or download the source
dependencies
pip3 install -r requirements.txt
test
python3 -m unittest holiday_jp.test
OR
make test
Build command:
python3 setup.py sdist
OR
make build
It will build the package and be available in the dist/ directory
alternative install
download the release and install this way: pip3 install holiday_jp-xxx.tar.gz
Usage
from holiday_jp import HolidayJp
# with string date YYYY-MM-DD
if HolidayJp('1990-01-01').is_holiday:
print('True')
import datetime
from holiday_jp import HolidayJp
# or date object
if HolidayJp(datetime.date.today()).is_holiday:
print('False')
else:
print('True')
# Between return holidays between 2 dates in text
holidays = HolidayJp.between('2009-01-01', '2009-01-31')
new_year_day = holidays[0]
self.assertEqual(datetime.date(year=2009, month=1, day=1), new_year_day.date_obj)
self.assertEqual('元日', new_year_day.name)
# Or date object
holidays = HolidayJp.between(datetime.date(year=2008, month=12, day=23), datetime.date(year=2009, month=1, day=12))
For more usage check the unit test holiday_jp/test.py
Metadata
Release files for holiday-jp 22.10.31
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| holiday_jp-22.10.31.tar.gz | 14.0 kB | Without provenance | Details for holiday_jp-22.10.31.tar.gz |
Release files / holiday_jp-22.10.31.tar.gz
| Download URL | holiday_jp-22.10.31.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cf130f59a53e5b332ce8062f382d1ce14d530228674c8f87207121cfe245c1b
|
|
BLAKE2b-256 checksum How to use checksums |
03d184481d97a46691b9e6de90051b4b521d9abba6f2d6607a42bd04a02f73df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Security for holiday-jp 22.10.31
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.