Skip to content

Instantly share code, notes, and snippets.

@kindly
Created October 29, 2012 12:23
Show Gist options
  • Select an option

  • Save kindly/3973242 to your computer and use it in GitHub Desktop.

Select an option

Save kindly/3973242 to your computer and use it in GitHub Desktop.
import requests
import time
import glob
result = glob.glob('/home/david/Downloads/json/*')
def run_documents():
for document in result:
print document
now = time.time()
moo = requests.post('http://0.0.0.0/open-data/data/api/action/package_create',
auth = ('ec', 'ecportal'),
headers = {'content-type': 'application/json', "X-CKAN-API-Key": "406e6266-5d44-4853-ab05-56994f43431b"},
data = open(document).read()
)
seconds = time.time() - now
print seconds
run_documents()
@kindly
Copy link
Author

kindly commented Oct 29, 2012

import nose
import cProfile
command = """nose.main(argv=['--ckan','--with-pylons=test-core.ini', 'ckan/tests', '-x', '-v'])"""
cProfile.runctx( command, globals(), locals(), filename="ckan.tests.profile" )
~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment