Skip to main content

python-publicholiday

Build Status Coverage Status PyPI version

A cli utility to help run things or not run things based on if it is a public holiday. The command exits 0 if today is a public holiday and exits 1 if not.

Installation: pip install publicholiday

Examples usage:

$ publicholiday --help
Usage: publicholiday [OPTIONS]

  Is it a public holiday?

Options:
  -c, --country TEXT  Supported country name or code.
  --help              Show this message and exit.

# Run a script on a public holiday
$ publicholiday && /thing/to/run.sh

# Run a script on all days that are not public holidays
$ publicholiday || /thing/to/run.sh

By default publicholiday will check against UK public holidays. You can change this by passing a supported country:

# Run a script on a Argentinian public holiday
$ publicholiday -c Argentina && /thing/to/run.sh

# Run a script on all days that are not US public holidays
$ publicholiday -c US || /thing/to/run.sh

This utility uses the holidays pip package, to find out if your country is supported see: https://pypi.org/project/holidays/

Release files for publicholiday 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for publicholiday 0.1.8
File Size Uploaded
publicholiday-0.1.8.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for publicholiday 0.1.8
File Interpreter ABI Platform
publicholiday-0.1.8-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 5.6 kB

Release files / publicholiday-0.1.8.tar.gz

Download URL publicholiday-0.1.8.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5fb7eb14885a384f58a6ea1481a3c54636253c78d09167cb42e0eed1d5224c15
BLAKE2b-256 checksum
How to use checksums
2b8e11041b446bc38eb86a05f292789519ca85a6479977a318d4d1deb4fae59e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / publicholiday-0.1.8-py2.py3-none-any.whl

Download URL publicholiday-0.1.8-py2.py3-none-any.whl
Size 2.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5bebd73978dcc61916999b1f7b6e4141f5841eddbd6953eaaddf2f7ce30b1d68
BLAKE2b-256 checksum
How to use checksums
6ae3a9d1046f6a26b90ddc19e8bb4f98f46f55bc9c677ced624c78e302e4ac17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

1 release file

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page