def json_from_url(url):
 error_message = ''
 url_handle = urllib.urlopen(url)
 url_contents = url_handle.read()
 try:
  parsed_json = json.loads(url_contents)
 except Exception as e:
  error_message = str(url_contents)
  print 'Error parsing JSON data in json_from_url(): ', str(e)
  return (None, error_message)
 return (parsed_json, error_message)

def json_from_url ( url ) : error_message = '' url_handle = urllib . urlopen ( url ) url_contents = url_handle . read ( ) try : parsed_json = json . loads ( url_contents ) except Exception as e : error_message = str ( url_contents ) print 'Error parsing JSON data in json_from_url(): ' , str ( e ) return ( None , error_message ) return ( parsed_json , error_message )
send a request to the tool shed via the tool shed api and handle the response .