Tool to load UK bank holidays from GOV.UK
Project description
This library loads the official list of bank holidays in the United Kingdom as supplied by GOV.UK. GOV.UK tend to provide this list for only a year or two into the future.
Usage
Install using pip install govuk-bank-holidays. Sample usage:
from govuk_bank_holidays.bank_holidays import BankHolidays
bank_holidays = BankHolidays()
for bank_holiday in bank_holidays.get_holidays():
print(bank_holiday['title'], '>', bank_holiday['date'])
print(bank_holidays.get_next_holiday())
# see BankHolidays source file for more methods and arguments…
# choose a different locale for holiday titles and notes
bank_holidays = BankHolidays(locale='cy')
Bank holidays differ around the UK. The GOV.UK source currently lists these for 3 “divisions”:
England and Wales
Scotland
Northern Ireland
… and many methods in this library take a division parameter (c.f. constants on BankHolidays class).
NB: If no division is specified, only holidays common to all divisions are returned.
Development
Please report bugs and open pull requests on GitHub.
Update translation files using python setup.py makemessages, e.g. when updating the i18n module or when adding new languages. Compile them using python setup.py compilemessages; this is required before testing and distribution.
Use python setup.py compilemessages test to run all tests.
Distribute a new version by updating the VERSION tuple in govuk_bank_holidays and run python setup.py compilemessages sdist bdist_wheel upload.
Copyright
Copyright (C) 2020 HM Government (Ministry of Justice Digital & Technology). See LICENSE.txt for further details.
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 govuk-bank-holidays-0.6.tar.gz
.
File metadata
- Download URL: govuk-bank-holidays-0.6.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86d884a8b134fed515c145a90f8d8b4a43bbd11270a84cc21c2126ba13392d50 |
|
MD5 | 035e1dd27a1c5b6e0f72225556711688 |
|
BLAKE2b-256 | c858489934c01015ddd85cc49e9995337923c68e4abe665e905882220ab719ff |
File details
Details for the file govuk_bank_holidays-0.6-py2.py3-none-any.whl
.
File metadata
- Download URL: govuk_bank_holidays-0.6-py2.py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e38723d00a7242ea021f63df48dd381fad7a4329c56589cf68b8a3ed9ff89e96 |
|
MD5 | 16deb12cfdb8f4310a3dc72c9d75948b |
|
BLAKE2b-256 | 4a1971a76c0a15c052e268ecd44d7c828c96812d0d6a27ba5e7c9d5f0a2b9d8f |