This Jupyter notebook shows the python library jsonstat.py in action. It shows how to explore dataset from cso.ie data provider.
In [1]:
# all import here
import os
import jsonstat
using a cache_dir
Caching can speed the development, and provides consistent results.
In [2]:
cache_dir = os.path.abspath(os.path.join("..", "tests", "fixtures", "www.cso.ie"))
jsonstat.cache_dir(cache_dir)
Out[2]:
using NQQ25 dataset
In [3]:
base_uri = 'http://www.cso.ie/StatbankServices/StatbankServices.svc/jsonservice/responseinstance/'
uri = base_uri + "NQQ25"
filename = "cso_ie-NQQ25.json"
In [4]:
collection_1 = jsonstat.from_url(uri, filename)
collection_1
Out[4]:
Previous collection contains only a dataset named 'nama_gdp_c
'
In [5]:
dataset = collection_1.dataset(0)
dataset
Out[5]:
In [6]:
dataset.dimension('Sector')
Out[6]:
In [7]:
dataset.dimension('Quarter')
Out[7]:
In [8]:
dataset.dimension('Statistic')
Out[8]:
Get value for year 2012.
In [9]:
dataset.data(Sector='03', Quarter='1997Q4', Statistic='NQQ25S1')
Out[9]: