frictionlessdata / datapackage-py

A Python library for working with Data Packages.
https://frictionlessdata.io
MIT License
191 stars 43 forks source link

remote resources can't read the data #161

Closed wengdanyu closed 7 years ago

wengdanyu commented 7 years ago

[:https://datahub.io/core/cofog#python)](The code from url:https://datahub.io/core/cofog#python) But the code i change into :dp.resources[0].read(),but merge errors

import datapackage
dp = datapackage.DataPackage('https://pkgstore.datahub.io/core/cofog/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)