Skip to main content

Is it a public holiday?

Project description

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/

Project details


Download files

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

Files for publicholiday, version 0.1.8
Filename, size File type Python version Upload date Hashes
Filename, size publicholiday-0.1.8-py2.py3-none-any.whl (2.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size publicholiday-0.1.8.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page