I have been challenged to make use of python ckan dataset. Please help me I want the image guide ... or even answer thanks...
>>> import requests
>>> import json
>>> url='http://demo.ckan.org/api/action/resource_create'
>>> auth_key='my key'
>>> datastore_structure = {
'resource_id' : 'hojintop' ,
'fields' : [ { "id" : "a" }, { "id" : "b" } ],
"records" : [ { "a" : 1 , "b" : "xyz" }, { "a" : 2 , "b" : "zzz" } ]}
>>> headers = { 'content-type' : 'application/json' , 'Authorization' : auth_key }
>>> r = requests . post ( url + 'datastore_create' , data = json . dumps ( datastore_structure ), headers = headers )
but mypython have no effect demockan site have no effect .... OMG........OTL......PLZ HELP ME...EASY GUIDE PLZ ..THANKYOU!
It's not clear what you're trying to do. For starters, it looks like you're trying to create a resource and a datastore in one transaction, which you can't do. If you are trying to create a resource, you have to associate it with an existing package by specifying the package_id. Here's the API documentation.