Created
July 20, 2018 13:15
-
-
Save timbirk/024a26c93aabbfadee802c7c5bb5bca1 to your computer and use it in GitHub Desktop.
Python script to detect if it's a UK bank holiday. Requires "holidays" pip package.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import holidays | |
from datetime import date | |
sys.exit(date.today() not in holidays.England()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've released a better version of this to PyPi as a package: https://pypi.org/project/publicholiday/
which handles all countries supported by: https://pypi.org/project/holidays/