Skip to content

Encapsulates timetable legislation for elections run in the United Kingdom and its devolved administrations. 🗳🕰

License

Notifications You must be signed in to change notification settings

DemocracyClub/uk-election-timetables

Repository files navigation

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.sopn_publish_date) # 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

About

Encapsulates timetable legislation for elections run in the United Kingdom and its devolved administrations. 🗳🕰

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages