In [1]:
from birdy import WPSClient
In [4]:
magic = WPSClient('https://cp4cds-cn2.dkrz.de/ows/proxy/magic_demo') # verify=False # progress=True
---------------------------------------------------------------------------
Error Traceback (most recent call last)
~/.conda/envs/birdy/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname)
471 try:
--> 472 cnx.do_handshake()
473 except OpenSSL.SSL.WantReadError:
~/.conda/envs/birdy/lib/python3.6/site-packages/OpenSSL/SSL.py in do_handshake(self)
1914 result = _lib.SSL_do_handshake(self._ssl)
-> 1915 self._raise_ssl_error(self._ssl, result)
1916
~/.conda/envs/birdy/lib/python3.6/site-packages/OpenSSL/SSL.py in _raise_ssl_error(self, ssl, result)
1646 else:
-> 1647 _raise_current_error()
1648
~/.conda/envs/birdy/lib/python3.6/site-packages/OpenSSL/_util.py in exception_from_error_queue(exception_type)
53
---> 54 raise exception_type(errors)
55
Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]
During handling of the above exception, another exception occurred:
SSLError Traceback (most recent call last)
~/.conda/envs/birdy/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
602 body=body, headers=headers,
--> 603 chunked=chunked)
604
~/.conda/envs/birdy/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
343 try:
--> 344 self._validate_conn(conn)
345 except (SocketTimeout, BaseSSLError) as e:
~/.conda/envs/birdy/lib/python3.6/site-packages/urllib3/connectionpool.py in _validate_conn(self, conn)
842 if not getattr(conn, 'sock', None): # AppEngine might not have `.sock`
--> 843 conn.connect()
844
~/.conda/envs/birdy/lib/python3.6/site-packages/urllib3/connection.py in connect(self)
369 server_hostname=server_hostname,
--> 370 ssl_context=context)
371
~/.conda/envs/birdy/lib/python3.6/site-packages/urllib3/util/ssl_.py in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password)
354 if HAS_SNI and server_hostname is not None:
--> 355 return context.wrap_socket(sock, server_hostname=server_hostname)
356
~/.conda/envs/birdy/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname)
477 except OpenSSL.SSL.Error as e:
--> 478 raise ssl.SSLError('bad handshake: %r' % e)
479 break
SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",)
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last)
~/.conda/envs/birdy/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
448 retries=self.max_retries,
--> 449 timeout=timeout
450 )
~/.conda/envs/birdy/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
640 retries = retries.increment(method, url, error=e, _pool=self,
--> 641 _stacktrace=sys.exc_info()[2])
642 retries.sleep()
~/.conda/envs/birdy/lib/python3.6/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
398 if new_retry.is_exhausted():
--> 399 raise MaxRetryError(_pool, url, error or ResponseError(cause))
400
MaxRetryError: HTTPSConnectionPool(host='cp4cds-cn2.dkrz.de', port=443): Max retries exceeded with url: /ows/proxy/magic_demo?service=WPS&request=GetCapabilities&version=1.0.0 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))
During handling of the above exception, another exception occurred:
SSLError Traceback (most recent call last)
<ipython-input-4-c3ee7610c7e9> in <module>
----> 1 magic = WPSClient('https://cp4cds-cn2.dkrz.de/ows/proxy/magic_demo') # verify=False # progress=True
~/git/Bird-house/birdy/birdy/client/base.py in __init__(self, url, processes, converters, username, password, headers, auth, verify, cert, verbose, progress, version, caps_xml, desc_xml)
106
107 try:
--> 108 self._wps.getcapabilities(xml=caps_xml)
109 except ServiceException as e:
110 if "AccessForbidden" in str(e):
~/.conda/envs/birdy/lib/python3.6/site-packages/owslib/wps.py in getcapabilities(self, xml)
269 else:
270 self._capabilities = reader.readFromUrl(
--> 271 self.url, headers=self.headers)
272
273 log.debug(element_to_string(self._capabilities))
~/.conda/envs/birdy/lib/python3.6/site-packages/owslib/wps.py in readFromUrl(self, url, username, password, headers, verify, cert)
531 self.timeout,
532 username=username, password=password,
--> 533 headers=headers, verify=verify, cert=cert)
534
535
~/.conda/envs/birdy/lib/python3.6/site-packages/owslib/wps.py in _readFromUrl(self, url, data, timeout, method, username, password, headers, verify, cert)
483 u = openURL(spliturl[0], spliturl[
484 1], method='Get', username=username, password=password,
--> 485 headers=headers, verify=verify, cert=cert, timeout=self.timeout)
486 return etree.fromstring(u.read())
487
~/.conda/envs/birdy/lib/python3.6/site-packages/owslib/util.py in openURL(url_base, data, method, cookies, username, password, timeout, headers, verify, cert, auth)
196 rkwargs['cookies'] = cookies
197
--> 198 req = requests.request(method.upper(), url_base, headers=headers, **rkwargs)
199
200 if req.status_code in [400, 401]:
~/.conda/envs/birdy/lib/python3.6/site-packages/requests/api.py in request(method, url, **kwargs)
58 # cases, and look like a memory leak in others.
59 with sessions.Session() as session:
---> 60 return session.request(method=method, url=url, **kwargs)
61
62
~/.conda/envs/birdy/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
531 }
532 send_kwargs.update(settings)
--> 533 resp = self.send(prep, **send_kwargs)
534
535 return resp
~/.conda/envs/birdy/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
644
645 # Send the request
--> 646 r = adapter.send(request, **kwargs)
647
648 # Total elapsed time of the request (approximately)
~/.conda/envs/birdy/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
512 if isinstance(e.reason, _SSLError):
513 # This branch is for urllib3 v1.22 and later.
--> 514 raise SSLError(e, request=request)
515
516 raise ConnectionError(e, request=request)
SSLError: HTTPSConnectionPool(host='cp4cds-cn2.dkrz.de', port=443): Max retries exceeded with url: /ows/proxy/magic_demo?service=WPS&request=GetCapabilities&version=1.0.0 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))
In [ ]:
help(magic.rainfarm)
In [ ]:
result = magic.rainfarm()
In [ ]:
print(result.getStatus())
print(result.statusMessage)
print(result.percentCompleted)
In [ ]:
result.get()
In [ ]:
result.get().success
In [ ]:
result = magic.consecdrydays()
In [ ]:
print(result.getStatus())
print(result.statusMessage)
print(result.percentCompleted)
In [ ]:
result.get()
In [ ]:
result.get().success
In [ ]:
result = magic.weather_regimes()
In [ ]:
print(result.getStatus())
print(result.statusMessage)
print(result.percentCompleted)
In [ ]:
result.get()
In [ ]:
result.get().success
In [ ]:
result = magic.modes_of_variability()
In [ ]:
print(result.getStatus())
print(result.statusMessage)
print(result.percentCompleted)
In [ ]:
result.get()
In [ ]:
result.get().success
Content source: bird-house/birdy
Similar notebooks: