Skip to main content

Python package with Czech public holidays

Project description

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 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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

czech-holidays-0.2.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

czech_holidays-0.2.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file czech-holidays-0.2.0.tar.gz.

File metadata

  • Download URL: czech-holidays-0.2.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.15 CPython/3.10.6 Darwin/21.5.0

File hashes

Hashes for czech-holidays-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a7c72b16a8277ad40da13fd4367dc64e7f2dbcff2de7cb4d38dadba0675b3d6f
MD5 ffa9ea0ab004030b97f17dfe96129d6f
BLAKE2b-256 8f8b4ee61daf65684879ab4044a40083194a5299bad6ff4ac09bcabdf11497d9

See more details on using hashes here.

File details

Details for the file czech_holidays-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: czech_holidays-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.15 CPython/3.10.6 Darwin/21.5.0

File hashes

Hashes for czech_holidays-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a0089184f3cb65a7a20502a54fd4bbc56024d01739e3ccfdf89058dda435737
MD5 a2a4f4589c3cb7995fe8fb6ae5e03ad7
BLAKE2b-256 0ac1bedc1d89296b5855cef7176847b74c625401f34d6be5ae54349b4cca8a1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page