Skip to content
/ parlscot Public

An R package to download Scottish Parliamentary data

Notifications You must be signed in to change notification settings

dbrby/parlscot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parlscot

parlscot provides a suite of functions to download data from the Scottish Parliamentary Record and the Scottish Parliament Open Data Platform.

Installation

You can install the development version of parlscot from GitHub with:

# install.packages("devtools")
devtools::install_github("dbraby/parlscot")

Example

To download speeches from the Spoken Record, we use the parlscot() function, passing a start and an end date will return a data.frame with each speaking instance as a row

library(parlscot)


df <- parlscot("2022-03-01", "2022-03-10")
#> Date1
#> Date2
#> Date3
#> Date4
#> Date5
#> Date6
#> Date7
#> Date8
#> Date9
#> Date10

get_scot() and get_scot_id() provide wrappers for the Scottish Parliament Public APIs.get_scot() will return all records, while get_scot_id() allows single cases to be returned (given you know the ID).

For both functions it is required you specify type =, for which there are 50 possible options, listed below:

get_scot <- (type = c("addresses",
                              "addresstypes",
                              "allowancesgrouptransactions",
                              "allowancetransactions",
                              "bills",
                              "billstages",
                              "billstagetypes",
                              "billtypes",
                              "committeeroles",
                              "committees",
                              "committeetypelinks",
                              "constituencies",
                              "crosspartygrouproles",
                              "crosspartygroups",
                              "departments",
                              "directorates",
                              "directoratetypes",
                              "electionreasondates",
                              "electionstatuses",
                              "emailaddresses",
                              "emailaddresstypes",
                              "events",
                              "genders",
                              "governmentroles",
                              "legislationdetails",
                              "membercrosspartyroles",
                              "memberelectionconstituencystatuses",
                              "memberelectionregionstatuses",
                              "membergovernmentroles",
                              "memberparties",
                              "memberpartyroles",
                              "members",
                              "motionsquestionsanswersmotions",
                              "parties",
                              "partyroles",
                              "personcommitteeroles",
                              "petitioncountries",
                              "petitiondiscussions",
                              "petitiononbehalfofs",
                              "petitions",
                              "petitionsignatures",
                              "petitionstatuses",
                              "petitionsubjectcategories",
                              "regions",
                              "registerofinterest",
                              "externalresearches",
                              "sessions",
                              "telephones",
                              "telephonetypes",
                              "websites",
                              "websitetypes"))

About

An R package to download Scottish Parliamentary data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages