govuk-bank-holidays


Namegovuk-bank-holidays JSON
Version 0.14 PyPI version JSON
download
home_pagehttps://github.com/ministryofjustice/govuk-bank-holidays
SummaryTool to load UK bank holidays from GOV.UK
upload_time2023-11-16 15:31:55
maintainer
docs_urlNone
authorMinistry of Justice Digital & Technology
requires_python>=3.6
licenseMIT
keywords bank holidays govuk uk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            GOV.UK Bank Holidays
====================

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.

A cached backup list of known bank holidays is stored in this package though it is not updated often.
GOV.UK no longer provide bank holidays for some of the older years still part of this backup list.

Usage
-----

Install using ``pip install govuk-bank-holidays``. Sample usage:

.. code-block:: python

    from govuk_bank_holidays.bank_holidays import BankHolidays

    bank_holidays = BankHolidays()
    for bank_holiday in bank_holidays.get_holidays():
        print(bank_holiday['title'], 'is on', bank_holiday['date'])
    print(bank_holidays.get_next_holiday())

    # see govuk_bank_holidays/bank_holidays.py source file for more methods and argument details…

    # choose a different locale for holiday titles and notes
    bank_holidays = BankHolidays(locale='cy')

    # use cached holidays if internet connection is not desired
    bank_holidays = BankHolidays(use_cached_holidays=True)

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 (see constants defined on ``BankHolidays`` class).

NB: If no division is specified, only holidays common to *all* divisions are returned so some local bank holidays
may not be listed. Therefore specifying a division is recommended.

While localisation is provided in English (the default with locale code 'en') and Welsh (locale code 'cy'),
please note that the Welsh version may contain errors.

Development
-----------

.. image:: https://github.com/ministryofjustice/govuk-bank-holidays/actions/workflows/test.yml/badge.svg?branch=main
    :target: https://github.com/ministryofjustice/govuk-bank-holidays/actions/workflows/test.yml

.. image:: https://github.com/ministryofjustice/govuk-bank-holidays/actions/workflows/lint.yml/badge.svg?branch=main
    :target: https://github.com/ministryofjustice/govuk-bank-holidays/actions/workflows/lint.yml

Please report bugs and open pull requests on `GitHub`_.

To work on changes to this library, it’s recommended to install it in editable mode into a virtual environment,
i.e. ``pip install --editable .``

Update cached bank holidays from GOV.UK using ``python scripts/update-cache.py``.

Update translation files using ``python scripts/messages.py update``, e.g. when updating the i18n module or when adding new languages.
Compile them using ``python scripts/messages.py compile``; this is *required* before testing and distribution.
Updating and compiling translation files requires the gettext system package to be installed.

Use ``python -m tests`` to run all tests locally.
Alternatively, you can use ``tox`` if you have multiple python versions.

[Only for GitHub team members] Distribute a new version to `PyPI`_ by:

- updating the ``VERSION`` tuple in ``govuk_bank_holidays/__init__.py``
- adding a note to the `History`_
- publishing a release on GitHub which triggers an upload to PyPI;
  alternatively, run ``python scripts/messages.py compile; python -m build; twine upload dist/*`` locally

History
-------

0.14
    Migrated test, build and release processes away from deprecated setuptools commands.
    Translation files are updated and compiled through scripts which are not included in distribution.
    The ``BankHolidays`` class has a new ``ALL_DIVISIONS`` constant.

0.13
    The library does not differ from 0.12.

0.12
    Removed support for python versions older than 3.7.
    Updated cached bank holidays file to include latest holidays published by GOV.UK.
    Moved code style linting from unit test to github action.
    Added setup.py command to update cached bank holidays from GOV.UK.

0.11
    Updated cached bank holidays file to include latest holidays published by GOV.UK.
    Added python 3.10 to testing matrix.

0.10
    Added methods to generate series of holidays and work days before/after starting from a given date.

0.9
    Added methods to find previous bank holidays / work days, mirroring the existing methods.
    Removed support for python versions older than 3.6.
    Added python 3.9 to testing matrix.

0.8
    The library does not differ from 0.7.
    This release is the first to use GitHub Actions to automatically publish to PyPI.

0.7
    Minor documentation update.

0.6
    Updated cached bank holidays file to include latest holidays published by GOV.UK.
    Added python 3.8 to testing matrix.
    Minor documentation update.

0.5
    Updated cached bank holidays file to include latest holidays published by GOV.UK.

0.4
    Updated cached bank holidays file to include latest holidays published by GOV.UK.
    Added python 3.7 to testing matrix.
    Documentation improved.

0.3
    Improved testing.
    Library unchanged.

0.2
    Updated cached bank holidays file to include latest holidays published by GOV.UK.
    Added option to force use of cached file.
    Added next work day calculation.

0.1
    Initial release.

Copyright
---------

Copyright (C) 2023 HM Government (Ministry of Justice Digital & Technology).
See LICENSE.txt for further details.

.. _GOV.UK: https://www.gov.uk/bank-holidays
.. _GitHub: https://github.com/ministryofjustice/govuk-bank-holidays
.. _PyPI: https://pypi.org/project/govuk-bank-holidays/

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ministryofjustice/govuk-bank-holidays",
    "name": "govuk-bank-holidays",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "bank holidays,govuk,uk",
    "author": "Ministry of Justice Digital & Technology",
    "author_email": "dev@digital.justice.gov.uk",
    "download_url": "https://files.pythonhosted.org/packages/ad/26/e0fef2b31a91b6aa9359686f1164128aef19d336bccf1fe931b599358697/govuk-bank-holidays-0.14.tar.gz",
    "platform": null,
    "description": "GOV.UK Bank Holidays\n====================\n\nThis library loads the official list of bank holidays in the United Kingdom as supplied by `GOV.UK`_.\nGOV.UK tend to provide this list for only a year or two into the future.\n\nA cached backup list of known bank holidays is stored in this package though it is not updated often.\nGOV.UK no longer provide bank holidays for some of the older years still part of this backup list.\n\nUsage\n-----\n\nInstall using ``pip install govuk-bank-holidays``. Sample usage:\n\n.. code-block:: python\n\n    from govuk_bank_holidays.bank_holidays import BankHolidays\n\n    bank_holidays = BankHolidays()\n    for bank_holiday in bank_holidays.get_holidays():\n        print(bank_holiday['title'], 'is on', bank_holiday['date'])\n    print(bank_holidays.get_next_holiday())\n\n    # see govuk_bank_holidays/bank_holidays.py source file for more methods and argument details\u2026\n\n    # choose a different locale for holiday titles and notes\n    bank_holidays = BankHolidays(locale='cy')\n\n    # use cached holidays if internet connection is not desired\n    bank_holidays = BankHolidays(use_cached_holidays=True)\n\nBank holidays differ around the UK. The GOV.UK source currently lists these for 3 \"divisions\":\n\n- England and Wales\n- Scotland\n- Northern Ireland\n\n\u2026 and many methods in this library take a ``division`` parameter (see constants defined on ``BankHolidays`` class).\n\nNB: If no division is specified, only holidays common to *all* divisions are returned so some local bank holidays\nmay not be listed. Therefore specifying a division is recommended.\n\nWhile localisation is provided in English (the default with locale code 'en') and Welsh (locale code 'cy'),\nplease note that the Welsh version may contain errors.\n\nDevelopment\n-----------\n\n.. image:: https://github.com/ministryofjustice/govuk-bank-holidays/actions/workflows/test.yml/badge.svg?branch=main\n    :target: https://github.com/ministryofjustice/govuk-bank-holidays/actions/workflows/test.yml\n\n.. image:: https://github.com/ministryofjustice/govuk-bank-holidays/actions/workflows/lint.yml/badge.svg?branch=main\n    :target: https://github.com/ministryofjustice/govuk-bank-holidays/actions/workflows/lint.yml\n\nPlease report bugs and open pull requests on `GitHub`_.\n\nTo work on changes to this library, it\u2019s recommended to install it in editable mode into a virtual environment,\ni.e. ``pip install --editable .``\n\nUpdate cached bank holidays from GOV.UK using ``python scripts/update-cache.py``.\n\nUpdate translation files using ``python scripts/messages.py update``, e.g. when updating the i18n module or when adding new languages.\nCompile them using ``python scripts/messages.py compile``; this is *required* before testing and distribution.\nUpdating and compiling translation files requires the gettext system package to be installed.\n\nUse ``python -m tests`` to run all tests locally.\nAlternatively, you can use ``tox`` if you have multiple python versions.\n\n[Only for GitHub team members] Distribute a new version to `PyPI`_ by:\n\n- updating the ``VERSION`` tuple in ``govuk_bank_holidays/__init__.py``\n- adding a note to the `History`_\n- publishing a release on GitHub which triggers an upload to PyPI;\n  alternatively, run ``python scripts/messages.py compile; python -m build; twine upload dist/*`` locally\n\nHistory\n-------\n\n0.14\n    Migrated test, build and release processes away from deprecated setuptools commands.\n    Translation files are updated and compiled through scripts which are not included in distribution.\n    The ``BankHolidays`` class has a new ``ALL_DIVISIONS`` constant.\n\n0.13\n    The library does not differ from 0.12.\n\n0.12\n    Removed support for python versions older than 3.7.\n    Updated cached bank holidays file to include latest holidays published by GOV.UK.\n    Moved code style linting from unit test to github action.\n    Added setup.py command to update cached bank holidays from GOV.UK.\n\n0.11\n    Updated cached bank holidays file to include latest holidays published by GOV.UK.\n    Added python 3.10 to testing matrix.\n\n0.10\n    Added methods to generate series of holidays and work days before/after starting from a given date.\n\n0.9\n    Added methods to find previous bank holidays / work days, mirroring the existing methods.\n    Removed support for python versions older than 3.6.\n    Added python 3.9 to testing matrix.\n\n0.8\n    The library does not differ from 0.7.\n    This release is the first to use GitHub Actions to automatically publish to PyPI.\n\n0.7\n    Minor documentation update.\n\n0.6\n    Updated cached bank holidays file to include latest holidays published by GOV.UK.\n    Added python 3.8 to testing matrix.\n    Minor documentation update.\n\n0.5\n    Updated cached bank holidays file to include latest holidays published by GOV.UK.\n\n0.4\n    Updated cached bank holidays file to include latest holidays published by GOV.UK.\n    Added python 3.7 to testing matrix.\n    Documentation improved.\n\n0.3\n    Improved testing.\n    Library unchanged.\n\n0.2\n    Updated cached bank holidays file to include latest holidays published by GOV.UK.\n    Added option to force use of cached file.\n    Added next work day calculation.\n\n0.1\n    Initial release.\n\nCopyright\n---------\n\nCopyright (C) 2023 HM Government (Ministry of Justice Digital & Technology).\nSee LICENSE.txt for further details.\n\n.. _GOV.UK: https://www.gov.uk/bank-holidays\n.. _GitHub: https://github.com/ministryofjustice/govuk-bank-holidays\n.. _PyPI: https://pypi.org/project/govuk-bank-holidays/\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Tool to load UK bank holidays from GOV.UK",
    "version": "0.14",
    "project_urls": {
        "Homepage": "https://github.com/ministryofjustice/govuk-bank-holidays"
    },
    "split_keywords": [
        "bank holidays",
        "govuk",
        "uk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "68517ffdf1c412bb5ed22002147f9ff57ba737a57ad8a5fd7d67a75dc68996e3",
                "md5": "a99d7c7dbfd6fe20a88b342eb08f081d",
                "sha256": "da485c4a40c6c874c925916e492e3f20b807cffba7eed5f07fb69327aef6b10b"
            },
            "downloads": -1,
            "filename": "govuk_bank_holidays-0.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a99d7c7dbfd6fe20a88b342eb08f081d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 13610,
            "upload_time": "2023-11-16T15:31:54",
            "upload_time_iso_8601": "2023-11-16T15:31:54.173537Z",
            "url": "https://files.pythonhosted.org/packages/68/51/7ffdf1c412bb5ed22002147f9ff57ba737a57ad8a5fd7d67a75dc68996e3/govuk_bank_holidays-0.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad26e0fef2b31a91b6aa9359686f1164128aef19d336bccf1fe931b599358697",
                "md5": "babd1a5ef0881c54b6b91f8c5194f3d1",
                "sha256": "ce85102423b72908957d25981f616494729686515d5d66c09a1d35a354ce20a6"
            },
            "downloads": -1,
            "filename": "govuk-bank-holidays-0.14.tar.gz",
            "has_sig": false,
            "md5_digest": "babd1a5ef0881c54b6b91f8c5194f3d1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 15461,
            "upload_time": "2023-11-16T15:31:55",
            "upload_time_iso_8601": "2023-11-16T15:31:55.960509Z",
            "url": "https://files.pythonhosted.org/packages/ad/26/e0fef2b31a91b6aa9359686f1164128aef19d336bccf1fe931b599358697/govuk-bank-holidays-0.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-16 15:31:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ministryofjustice",
    "github_project": "govuk-bank-holidays",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "govuk-bank-holidays"
}
        
Elapsed time: 0.42251s