pandasdmx KeyError on some OECD data sets

94 views
Skip to first unread message

Petras Saduikis

unread,
Nov 9, 2017, 5:11:23 AM11/9/17
to Statistical data and metadata exchange with SDMX and Python


I've noticed a number of OECD data sets cause pandasdmx (version 0.7.0) to throw a KeyError exception, for example 'http://stats.oecd.org/sdmx-json/data/WILD_LIFE/..AUS/all' (this particular query returns a JSON data set that has no time period dimension).

from pandasdmx import Request

# http://stats.oecd.org/sdmx-json/data/WILD_LIFE/..AUS/all

oecd = Request('OECD')

try:
    data_response = oecd.data(resource_id='WILD_LIFE', key='..AUS/all')
except KeyError:
    print('KeyError')
else:
    if data_response.status_code == 200:
        oecd_data = data_response.data   # etc.
        print('completed ...')
    else:
        print('Failed with code ', data_response.status_code)

Is there any way to get pandasdmx to accept OECD SDMX-JSON data sets like this?

Reply all
Reply to author
Forward
0 new messages