A Python client for Opendatasoft's Explore API (v2). ods-explore provides a querying interface inspired by the Django Queryset API, which converts queries to the Opendatasoft Query Language ODSQL internally. ๐ ๐
pip install ods_explore
from ods_explore.opendatasoft import Opendatasoft
ods = Opendatasoft(subdomain='documentation-resources')
# get datasets in a catalog
ods.catalog.datasets.get()
# get one dataset
ods.catalog.dataset('doc-geonames-cities-5000').get()
# get records in a dataset
ods.catalog.dataset('doc-geonames-cities-5000').records.get()
# get the least-populated cities only
(
ods
.catalog
.dataset('doc-geonames-cities-5000')
.records
.filter(population__lt=500)
.get()
)
# get one record
(
ods
.catalog
.dataset('doc-geonames-cities-5000')
.record('24eec8bff4f5b55afdeeeacb326167ed6b1e933a')
.get()
)
See docs/api.md for detailed documentation of ods_explore classes and usage patterns.