Skip to content
Derive publish dates of Statements of Persons Nominated for UK elections
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status Code style: black

Given the polling day of an election in the UK, when should the Statement of Persons Nominated (SoPN) should be published?

Turns out this is a non-trivial question, depending on:

  • type of election
  • country
  • calendars and bank holidays


This library defines a class StatementPublishDate with two functions:

  • for_id takes a string election_id in uk-election-ids format and:

    • Returns a datetime where the location of the election is unambiguous e.g. Scottish Parliamentary elections
    • Throws an exception where the location of the election is ambiguous e.g. local, parl
  • for_country takes a string country and a datetime and:

    • Returns a datetime where the country is in the united kingdom
    • Throws an exception where the country is unknown


from sopn_publish_date import StatementPublishDate
from datetime import datetime

sopn_publish_date = StatementPublishDate()

# Taking an id

# Taking a country and date
sopn_publish_date.for_country('scotland', datetime(2019, 2, 23))


python -m pytest


Election types:

  • Local
  • Parliament
  • Scottish Parliament
  • National Assembly for Wales
  • Northern Irish Assembly
  • Mayoral
  • EU parliament
  • Greater London Assembly
  • Police and Crime commissioner


  • England + Wales
  • Scotland
  • Northern Ireland
  • Fixed-date bank holidays e.g. royal weddings

Useful Links (delete pre-1.0)

Relevant Legislation

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.