Created
September 25, 2014 10:25
-
-
Save XavierVal/1815273cb1f700e203d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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