Czech holidays on PyPI.
Project description
Python package with Czech public holidays.
Installation
The Cheese Shop:
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 provide simple interface:
>>> from czech_holidays import holidays
>>> holidays
[Holiday(2013, 1, 1), Holiday(2013, 1, 1), Holiday(2013, 4, 1), Holiday(2013, 5, 1), Holiday(2013, 5, 8), Holiday(2013, 7, 5), Holiday(2013, 7, 6), Holiday(2013, 9, 28), Holiday(2013, 10, 28), Holiday(2013, 11, 17), Holiday(2013, 12, 24), Holiday(2013, 12, 25), Holiday(2013, 12, 26)]
Two shortcuts are available:
>>> holidays.easter
Holiday(2013, 4, 1)
>>> holidays.christmas
Holiday(2013, 12, 24)
Otherwise holidays behaves as an ordinary list. If you need holidays for different year, you can make your own Holidays object:
>>> from czech_holidays import Holidays
>>> holidays = Holidays(2020)
>>> holidays.easter
Holiday(2020, 4, 13)
Holiday object behaves as an ordinary datetime.date object:
>>> from czech_holidays import holidays
>>> holiday = holidays[5] # arbitrary holiday
>>> holiday.day
5
>>> holiday.year
2013
>>> from datetime import timedelta
>>> holidays[5] + timedelta(days=4)
datetime.date(2013, 7, 9)
It also has some extra properties:
>>> holiday.name
u'Den slovansk\xfdch v\u011brozv\u011bst\u016f Cyrila a Metod\u011bje'
>>> holiday.name_en
u'Saints Cyril and Methodius Day'
Aim of this library is to simplify work with Czech public holidays in current applications, thus it does not provide any historical data. For example, Restoration Day of the Independent Czech State is celebrated since 2000, but the library returns it also for, let’s say, 1978.
License: MIT
© 2013 Jan Javorek <jan.javorek@gmail.com>
This work is licensed under MIT license.
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
Built Distribution
File details
Details for the file czech-holidays-0.1.3.tar.gz
.
File metadata
- Download URL: czech-holidays-0.1.3.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31ef8acbadf82e8bba1c4060d3ceacb8c2f5943a3e8348798b5ddedeba3b82af |
|
MD5 | 1fec892d603c14e639aae93eb02eac92 |
|
BLAKE2b-256 | 19d052b6bfa7f7f006d83b036ac27513dd6441a2da651e4e7c76a4e314414437 |
File details
Details for the file czech_holidays-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: czech_holidays-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 536cb6f83b4f26f3a1b95c7ecd6a5f384ed39b4769445aefe6c0b0fe934ea3d6 |
|
MD5 | bb495f232c6b68caf1eb6464b2a70a82 |
|
BLAKE2b-256 | 62eab6ddde789951ffe06acaba83948ab6a941ff37d561730e0836c8e561d70f |