Learn R Programming

hansard: Accessing Westminster Parliament Data

An R package to automatically fetch data from the UK Parliament API. Ironically, Hansard data (as in speeches) is not yet accessible through the API. To explore all available data see http://www.data.parliament.uk/. Documentation for the API itself is available here.

Like the UK parliament API, this package is a work in progress. Additional functionalities will be added to the package as they are developed in the API. The most up-to-date documentation for this package will always be available at https://docs.evanodell.com/hansard/.

To install from CRAN run:

install.packages("hansard")

To install the development version run:

#install.packages("remotes")
remotes::install_github("evanodell/hansard")

Using hansard

For an introduction to hansard, please see the vignette. If you are unfamiliar with web APIs this introductory course is useful.

Disclaimer

This package is in no way officially related to or endorsed by the UK Parliamentary Data Service. It is released under an MIT license. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Citing hansard

Odell E (2017). hansard: Provides Easy Downloading Capabilities for the UK Parliament API. doi: 10.5281/zenodo.591264, R package version 0.8.0, URL: https://cran.r-project.org/package=hansard.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {{hansard}: Provides Easy Downloading Capabilities for the UK Parliament API},
    author = {Evan Odell},
    note = {R package version 0.8.0},
    doi = {10.5281/zenodo.591264},
    url = {https://cran.r-project.org/package=hansard},
  }

Copy Link

Version

Install

install.packages('hansard')

Monthly Downloads

30

Version

0.8.0

License

MIT + file LICENSE

Maintainer

Evan Odell evanodell91@gmail.com

Last Published

November 13th, 2019

Functions in hansard (0.8.0)

constituencies

House of Commons constituencies
lords_attendance_date

House of Lords attendance by date
research_topics_list

Lists of research briefing topics, subtopics and types.
early_day_motions

Early day motion data
lords_attendance_session

House of Lords attendance by session
sessions_info

Parliamentary Session data
lord_vote_record

Voting record of members of the House of Lords
commons_terms

Parliamentary Thesaurus
commons_written_questions

House of Commons Written Questions
commons_answered_questions

House of Commons answered questions
elections

General and By-Elections
lords_amendments

House of Lords Amendments.
mp_vote_record

Individual MP voting records
lords_ammendments

Defunct parameters for hansard package
epetition

Individual epetitions
lords_attendance

hansard

hansard: Provides Easy Downloading Capabilities for the UK Parliament API
election_candidates

Election candidate details
research_briefings

Parliamentary Research Briefings
epetition_tibble

Bulk Epetition data
publication_logs

House publications
papers_laid

Papers laid
election_results

General and By-Election Results
lords_written_questions

House of Lords written questions
members_search

Search for an MP or Peer by name and constituency
tv_programmes

TV broadcast data
lords_sessions

Lords sessions
members

Members of both houses
lords_divisions

House of Lords divisions
lords_interests

Peers' registered interests
mp_questions

Questions asked by a given MP or MPs
mp_edms

Early Day Motions by MP or Peer
bill_publication_types

all_answered_questions

All answered parliamentary questions
bills

Bill data
bill_publications

Bill Publications
bill_stage_types

Bill Stage Types
commons_oral_question_times

Commons oral question times
commons_oral_questions

House of Commons Oral Questions
commons_division_date

House of Commons Division Dates
commons_divisions

House of Commons divisions