To get Data Package run following code in datahub

here is the url :https://datahub.io/core/eu-emissions-trading-system#python
It gets wrong when i run the last code

import datapackage
dp = datapackage.DataPackage('https://pkgstore.datahub.io/core/eu-emissions-trading-system/latest/datapackage.json')
# see metadata
print(dp.descriptor)
# get list of csv files
csvList = [dp.resources[x].descriptor['name'] for x in range(0,len(dp.resources))]
print(csvList) # ["resource name", ...]

# access csv file by the index starting 0
print(dp.resources[0].data)

This topic was automatically closed after 7 days. New replies are no longer allowed.

Hey Weng,

Inviting you to create an issue here Issues · datopian/datahub-qa · GitHub or a discussion here datahubio/chat - Gitter