Skip to content

Instantly share code, notes, and snippets.

@XavierVal
Created September 25, 2014 10:25
Show Gist options
  • Save XavierVal/1815273cb1f700e203d5 to your computer and use it in GitHub Desktop.
Save XavierVal/1815273cb1f700e203d5 to your computer and use it in GitHub Desktop.
import ckanapi
class CkanUtils(object):
def ckanDataset(comp, service, secure=False):
# collect all the input data and mixed it with the template to send
url = world.c[comp]["endpoint"]
ckan = ckanapi.RemoteCKAN(world.c[comp]["endpoint"], apikey=world.c[comp]["apikey"],
user_agent='ckanapiexample/1.0 (+http://example.com/my/website)')
try:
print ckan.action.package_create(name='my-datasetBorrar', title='this will work fine')
except ckanapi.ValidationError:
print 'unless Ddataset already exists'
TestUtils.log_result(url=url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment