To get Data Package run following code in datahub

frictionlessdata

#1

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)

#2

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


#3

#4

Hey Weng,

Inviting you to create an issue here https://github.com/datahubio/qa/issues or a discussion here https://gitter.im/datahubio/chat