src/download_raw_data.py
def grab_ons_time_series_data(dataset_id, timeseries_id):
    """ Grabs specified time series from the ONS API. """
    api_endpoint = "https://api.ons.gov.uk/"
    api_params = {
                  'dataset': dataset_id,
                  'timeseries': timeseries_id
                  }
    url = (api_endpoint +
           '/'.join([x+'/'+y for x, y in zip(api_params.keys(),
                                             api_params.values())][::-1]) +
           '/data')
    return requests.get(url).json()
 Grabs specified time series from the ONS API. 
Grabs specified time series from the ONS API.
Grabs specified time series from the ONS API .
def grab_ons_time_series_data(dataset_id, timeseries_id):
    api_endpoint = "https://api.ons.gov.uk/"
    api_params = {
                  'dataset': dataset_id,
                  'timeseries': timeseries_id
                  }
    url = (api_endpoint +
           '/'.join([x+'/'+y for x, y in zip(api_params.keys(),
                                             api_params.values())][::-1]) +
           '/data')
    return requests.get(url).json()
def grab_ons_time_series_data ( dataset_id , timeseries_id ) : api_endpoint = "https://api.ons.gov.uk/" api_params = { 'dataset' : dataset_id , 'timeseries' : timeseries_id } url = ( api_endpoint + '/' . join ( [ x + '/' + y for x , y in zip ( api_params . keys ( ) , api_params . values ( ) ) ] [ : : - 1 ] ) + '/data' ) return requests . get ( url ) . json ( )
Grabs specified time series from the ONS API.
Grabs specified time series from the ONS API .
""" Grabs specified time series from the ONS API. """
dataset_id
timeseries_id