Question

I am trying to automate dataset and resource uploading in my CKAN instance. I am using Ubuntu Linux 10.04 64-bit and my CKAN instance version is 1.8.

I can create a new dataset using the command like like so:

$ curl http://ckan.installation.com/api/rest/dataset -H "Authorization:<my api key>" -d '{"name": "dataset-name", "title": "The Name of the Dataset"}'
{... JSON text recieved in response, including the id of the dataset ...}

Now, how do I go about creating and uploading resources (like image files) in my CKAN instance using the command line?

Thanks!

Was it helpful?

Solution

Uploading a file through the FileStore API is somewhat complicated. You'll be better reusing ckanclient's upload_file method. A simple Python script that uses this could solve your problem of uploading from the command-line.

Or, if you're feeling brave, that's the best place to start understanding how to upload a file using cURL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top