Skip to content

Instantly share code, notes, and snippets.

@olihawkins
olihawkins / coronavirus-api.R
Last active June 10, 2021 08:50
Download data on Coronavirus cases and deaths from the government dashboard API
# Functions for downloading data on Coronavirus cases in the UK by country,
# region, NHS region, and local authority from the government dashboard API.
#
# The developer guide is here:
#
# https://coronavirus.data.gov.uk/developers-guide
#
# The code below is based on the example code shown there.
#
# Run ...
@olihawkins
olihawkins / members_email.py
Created March 31, 2019 16:46
How to download Members' email addresses from the Parliamentary Data Platform using pdpy
# -*- coding: utf-8 -*-
import pdpy
def fetch_mps_email():
return fetch_members_email(house=pdpy.constants.PDP_ID_HOUSE_OF_COMMONS)
def fetch_lords_email():
return fetch_members_email(house=pdpy.constants.PDP_ID_HOUSE_OF_LORDS)
@olihawkins
olihawkins / planets.py
Created February 10, 2019 15:18
Python module for downloading planetary data for More or Less
# -*- coding: utf-8 -*-
"""
This is the Python module I used for scraping planetary data for the BBC radio
programme More or Less. You can read more about it here:
http://olihawkins.com/2019/02/1
"""