Skip to main content

Tool to load UK bank holidays from GOV.UK

Project description

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())

# 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

https://travis-ci.org/ministryofjustice/govuk-bank-holidays.svg?branch=master

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.

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

govuk-bank-holidays-0.5.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

govuk_bank_holidays-0.5-py2.py3-none-any.whl (11.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file govuk-bank-holidays-0.5.tar.gz.

File metadata

  • Download URL: govuk-bank-holidays-0.5.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for govuk-bank-holidays-0.5.tar.gz
Algorithm Hash digest
SHA256 f6c2a16e618718bf6ab167f753ec22add75fbfec90a711ed9928003b442ce0d1
MD5 e474dd3cf811600524e5f9904e769169
BLAKE2b-256 d176fdce5efd8e45977f864063b9677854609e055c9756b2030ec72b15d1af59

See more details on using hashes here.

File details

Details for the file govuk_bank_holidays-0.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for govuk_bank_holidays-0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7ca5470c67a4c565789f0dbcb58795daea527d14399cfcd1b9e16d6916ca44e9
MD5 ffabcf6798c0aa9ad885bf163e66aec2
BLAKE2b-256 7da2db8f6074436d18488c992ae3561e9ac3fdd489a8e9bc945bb4a4fea359ab

See more details on using hashes here.

Supported by

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