bolster.data_sources.niassembly.votes
NI Assembly Votes / Divisions data module.
Fetches plenary division (vote) records from the NI Assembly AIMS API.
Divisions are fetched by date range via GetVotesOnDivision_JSON and
per-member vote records are fetched via GetDivisionMemberVoting
(which returns XML).
Update frequency: Real-time.
Example
>>> from bolster.data_sources.niassembly import votes
>>> df = votes.get_all_divisions()
>>> len(df) > 100
True
>>> "DivisionDate" in df.columns
True
Attributes
Functions
|
Return all Assembly divisions (votes) in a date range as a DataFrame. |
|
Return per-member voting records for a single division. |
Module Contents
- bolster.data_sources.niassembly.votes.get_all_divisions(start_date=None, end_date=None)[source]
Return all Assembly divisions (votes) in a date range as a DataFrame.
Defaults to fetching from the start of the current Assembly mandate (2022-05-01) to today. Pass explicit dates for a narrower or wider window.
- Parameters:
- Returns:
EventID, SessionID, DocumentID, DivisionDate, DivisionSubject, DivisonType, DivisionResult, MemberVoting. Returns an empty DataFrame if no divisions are found.
- Return type:
DataFrame with columns
- Raises:
requests.HTTPError – If the API request fails.
Example
>>> df = get_all_divisions() >>> len(df) >= 0 True >>> "DivisionSubject" in df.columns True
- bolster.data_sources.niassembly.votes.get_division_votes(division_id)[source]
Return per-member voting records for a single division.
Fetches
GetDivisionMemberVoting(XML) and parses member vote records.- Parameters:
division_id (int) – NI Assembly AIMS DocumentID for the division.
- Returns:
DocumentID, EventID, PersonID, MemberName, Vote, Designation, VoteInVacancy, MemberSortName. Returns an empty DataFrame if no records are found.
- Return type:
DataFrame with columns
- Raises:
requests.HTTPError – If the API request fails.
Example
>>> df = get_division_votes(406283) >>> "Vote" in df.columns True >>> len(df) > 0 True