mysociety / parlparse

The scraper/parser that produces data for TheyWorkForYou, PublicWhip, etc
Other
61 stars 22 forks source link

Add start/end reasons to London Assembly memberships #103

Closed jacksonj04 closed 5 years ago

jacksonj04 commented 5 years ago

Adds start_reason and end_reason data to memberships from London Assembly.

For start_reason, defaults to unknown, except for if:

  1. The membership has an "elected in" property, in which case start_reason is regional_election, or;
  2. For memberships where the person has previously ended a membership with changed_party, if the end date of that membership matches the start date of this one, assume the start reason is also changed_party.

For end_reason, will default to unknown but will raise a warning whilst doing so (this should usually be provided explicitly in Wikidata). Mappings between Wikidata IDs and ParlParse reason codes are in the END_REASON_MAP hash.