Skip to main content

Derives significant dates for UK elections

Project description

uk-election-timetables

CircleCI Documentation Status PyPI Ruff

This library encapsulates timetable legislation for elections run in the United Kingdom and its devolved administrations.

The election timetable varies based on:

  • Type of Post - Parliamentary, Local, devolved Government, etc.
  • Country - The United Kingdom has up to four different rules for the same type of election, one for each country.
  • Calendar - each country has their own unique set of Bank Holidays.

Usage (publishing of candidate lists)

from datetime import date
from uk_election_timetables.elections.uk_parliament import UKParliamentElection

election = UKParliamentElection(date(2019, 2, 21))

print(election.close_of_nominations) # date(2019, 1, 25)

Updating Bank Holiday Dates

This project checks daily for additions to the government bank holiday dataset at https://www.gov.uk/bank-holidays.json. When an addition is identified in the .gov file, this project will automatically create a GitHub issue to update our local bank holiday dataset.

To update bank-holidays.json with additions from the government supplied file, run the following within your venv:

python manage_bank_holidays.py --update

Documentation

Hosted by readthedocs at https://uk-election-timetables.readthedocs.io/

Installation

pip install uk_election_timetables

Test

pytest

Supported Election Types

  • Local
  • City of London Local
  • United Kingdom Parliament
  • Scottish Parliament
  • Senedd Cymru
  • Northern Ireland Assembly
  • Mayoral
  • Mayoral (London)
  • Greater London Assembly
  • Police and Crime commissioner
  • Referendum

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

uk_election_timetables-5.0.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uk_election_timetables-5.0.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file uk_election_timetables-5.0.0.tar.gz.

File metadata

  • Download URL: uk_election_timetables-5.0.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uk_election_timetables-5.0.0.tar.gz
Algorithm Hash digest
SHA256 f6d6db174d9e0fcc9a29a8167047530b6d7b93a27af4958c0195fa293e307fba
MD5 e9b5a7f7c89f01319081569cadb08aad
BLAKE2b-256 330634e1ad5f782b6e72f56d3d950d7f364dfe1554362aff7d218f494218ff7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for uk_election_timetables-5.0.0.tar.gz:

Publisher: python-publish.yml on DemocracyClub/uk-election-timetables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uk_election_timetables-5.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for uk_election_timetables-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f85d746b7778bb8b901b1cce0dd92b16592d5fe5a3f7ce2c5c6ebd2ceb71d28
MD5 2dfe94db674dccf2592eac3d45559544
BLAKE2b-256 528a1220516bc7c3fe46b5dce6d7a8b67bf601e3c5d1757a9e66a2f804b8ba41

See more details on using hashes here.

Provenance

The following attestation bundles were made for uk_election_timetables-5.0.0-py3-none-any.whl:

Publisher: python-publish.yml on DemocracyClub/uk-election-timetables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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