Python package with Czech public holidays.
Installation
From PyPI:
pip install czech-holidays
In case you have an adventurous mind, give a try to the source:
pip install git+https://github.com/honzajavorek/czech-holidays.git#egg=czech-holidays
Examples
Czech Holidays provides the following interface:
>>> from czech_holidays import czech_holidays
>>> holidays = czech_holidays(2022)
>>> holidays[:3]
[Holiday(date=datetime.date(2022, 1, 1), name='Nový rok', name_en="New Year's Day"),
Holiday(date=datetime.date(2022, 1, 1), name='Den obnovy samostatného českého státu', name_en='Restoration Day of the Independent Czech State'),
Holiday(date=datetime.date(2022, 4, 18), name='Velikonoční pondělí', name_en='Easter Monday')]
The function accepts year as a single argument and returns a list of named tuples:
>>> holidays[0].date
datetime.date(2022, 1, 1)
>>> holidays[0].name
'Nový rok'
>>> holidays[0].name_en
"New Year's Day"
Albeit named, it’s still just a tuple:
>>> holidays[0][0]
datetime.date(2022, 1, 1)
>>> holidays[0][1]
'Nový rok'
>>> holidays[0][2]
"New Year's Day"
>>> tuple(holidays[0])
(datetime.date(2022, 1, 1), 'Nový rok', "New Year's Day")
>>> holidays[0] < holidays[5]
True
Two shortcuts are available:
>>> from czech_holidays import czech_easter, czech_christmas
>>> czech_easter(2022)
Holiday(date=datetime.date(2022, 4, 18), name='Velikonoční pondělí', name_en='Easter Monday')
>>> czech_christmas(2022)
Holiday(date=datetime.date(2022, 12, 24), name='Štědrý den', name_en='Christmas Eve')
The aim of this library is to simplify work with Czech public holidays in current applications, thus it does not provide any historical data:
>>> czech_holidays(2013)
Traceback (most recent call last):
NotImplementedError: ...
Development
Install using poetry:
git clone git@github.com:honzajavorek/czech-holidays.git cd czech-holidays poetry install
Then run tests:
pytest
License: MIT
© 2022 Honza Javorek <mail@honzajavorek.cz>
This work is licensed under MIT license.
Metadata
Release files for czech-holidays 1.0.0
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 | |
|---|---|---|---|---|
| czech-holidays-1.0.0.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| czech_holidays-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 kB
Release files / czech-holidays-1.0.0.tar.gz
| Download URL | czech-holidays-1.0.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98bdc4d966ea92f69878d496b2d91d3dcb2dc810371d9fe932bf40f6d5187106
|
|
BLAKE2b-256 checksum How to use checksums |
d4803caa40060eb29a3d121acd63c14e0afa72e26fb50384780b4a1122ea3c9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.15 CPython/3.10.6 Darwin/21.5.0
|
Release files / czech_holidays-1.0.0-py3-none-any.whl
| Download URL | czech_holidays-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
981733d3d284fcb0cdee32d7f33606eef03c0018e03a2296cbfeebeb928ac98d
|
|
BLAKE2b-256 checksum How to use checksums |
824b061b9475cdb26c774a68cc70db0f5023b49421390939ca712d713c114c92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.15 CPython/3.10.6 Darwin/21.5.0
|
Security for czech-holidays 1.0.0
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.