[ckan-dev] insertion of datasets

David Read david.read at okfn.org
Sun Feb 5 09:58:52 UTC 2012


Rucha,

You need to replace "myckaninstance.com <http://myckaninstance.com/api>"
with the host name of the CKAN server you want to talk to. For testing you
can use test.ckan.org, or maybe you have your own CKAN site running.

David

On 9 December 2011 03:01, rucha pandav <rucha.pandav at gmail.com> wrote:

> Hi,
>
> I have just installed ckan and I am facing some problems while inserting
> data.
>
> Please let me know the exact procedure to insert datasets using web
> interface and harvest methods.
>
> I tried to execute the python example given in the package installation
> and I am getting some errors.
>
> The example is:
>
> import ckanclient
> # Instantiate the CKAN client.
> ckan = ckanclient.CkanClient(api_key=my_api_key, base_location="http://myckaninstance.com/api")
> # Describe the dataset.
> dataset_entity = {
>       'name': my_dataset_name,
>
>       'url': my_dataset_url,
>       'download_url': my_dataset_download_url,
>
>       'tags': my_dataset_keywords,
>       'notes': my_dataset_long_description,
> }
> # Register the dataset.
> ckan.package_register_post(dataset_entity)
>
>
>
> The errors which I get are:
>
> Traceback (most recent call last):
>   File "script1.py", line 13, in <module>
>     ckan.package_register_post(dataset_entity)
>   File "/usr/local/lib/python2.6/dist-packages/ckanclient/__init__.py",
> line 374, in package_register_post
>     self.open_url(url, data, headers)
>   File "/usr/local/lib/python2.6/dist-packages/ckanclient/__init__.py",
> line 348, in open_url
>     raise CkanApiError(self.last_message)
> ckanclient.CkanApiError: [Errno -2] Name or service not known
>
> Please can you let me know what is the problem.
>
> Kind Regards,
> Rucha.
>
>
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120205/a14661d4/attachment.html>


More information about the ckan-dev mailing list