Access to CKAN Datasource

DataStore supports an access to CKAN API. Websites which has CKAN API are listed in the following URL.

Initialize CKAN Datasource

To create DataStore for CKAN access, pass URL offers API. For example, offers API via:

In this case, any of following 4 URL formats can be used for DataStore initialization.

In [1]: import pyopendata as pyod

In [2]: pyod.DataStore('')
Out[2]: CKANStore (

In [3]: pyod.DataStore('')
Out[3]: CKANStore (

In [4]: pyod.DataStore('')
Out[4]: CKANStore (

In [5]: pyod.DataStore('')
Out[5]: CKANStore (


DateStore validates the input URL using CKAN site_read function. If this function is closed on the target website, initialization should fail. In this case, instantiate pyod.CKANStore directly.

For example, doesn’t allow to use site_read.

# should fail
In [6]: pyod.DataStore('')
ValueError                                Traceback (most recent call last)
<ipython-input-6-523a640bdcc0> in <module>()
----> 1 pyod.DataStore('')

/home/docs/checkouts/ in __new__(cls, kind_or_url, proxies)
    172             if store.is_valid():
    173                 return store
--> 174         raise ValueError('Unable to initialize DataStore with {0}'.format(kind_or_url))
    176     def __init__(self, kid_or_url=None, proxies=None):

ValueError: Unable to initialize DataStore with

# should be OK
In [7]: pyod.CKANStore('')
Out[7]: CKANStore (

Read Data

Once you create DataStore, you can access to data as described in Basic Usage.