frictionlessdata / datapackage-py

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

support loading from repository #282

Closed garfieldnate closed 3 years ago

garfieldnate commented 3 years ago

Overview

I've added a datapackage.json to my repository, which also contain my data: https://github.com/garfieldnate/cc-cedict_baidu. I had thought that this would make it simple to load the data in python just using the repository URL, by I haven't found any documentation on this use case.

If it's already possible, an example snippet in the readme or other documentation would be great. If it's not possible, then call it a feature request :) .


Please preserve this line to notify @pwalsh (lead of this repository)

pwalsh commented 3 years ago

Hey @garfieldnate - you can load from any valid URL. See some examples in the tests:

https://github.com/frictionlessdata/datapackage-py/blob/main/tests/test_package.py#L82

You would have to use the raw path for the file, not the GitHub UI url for the file, so:

https://raw.githubusercontent.com/garfieldnate/cc-cedict_baidu/master/datapackage.json

garfieldnate commented 3 years ago

Works like a charm. Thanks! I wrote some simple instructions in my repository readme for users. I think just a small note in your project readme with the information you shared in your comment above would be very helpful.

pwalsh commented 3 years ago

Thanks @garfieldnate