qhana_plugin_runner.util.request_helpers module

Adapters to load file:// and data: URLs with requests

class qhana_plugin_runner.util.request_helpers.DataAdapter

Bases: BaseAdapter

Adapter to load data: URLs.

send(request: PreparedRequest, stream: bool, **kwargs) Response

Sends PreparedRequest object. Returns Response object.

Parameters:
  • request – The PreparedRequest being sent.

  • stream – (optional) Whether to stream the request content.

  • timeout (float or tuple) – (optional) How long to wait for the server to send data before giving up, as a float, or a (connect timeout, read timeout) tuple.

  • verify – (optional) Either a boolean, in which case it controls whether we verify the server’s TLS certificate, or a string, in which case it must be a path to a CA bundle to use

  • cert – (optional) Any user-provided SSL certificate to be trusted.

  • proxies – (optional) The proxies dictionary to apply to the request.

class qhana_plugin_runner.util.request_helpers.FileAdapter

Bases: BaseAdapter

Adapter to load file:// URLs.

send(request: PreparedRequest, stream: bool, **kwargs) Response

Sends PreparedRequest object. Returns Response object.

Parameters:
  • request – The PreparedRequest being sent.

  • stream – (optional) Whether to stream the request content.

  • timeout (float or tuple) – (optional) How long to wait for the server to send data before giving up, as a float, or a (connect timeout, read timeout) tuple.

  • verify – (optional) Either a boolean, in which case it controls whether we verify the server’s TLS certificate, or a string, in which case it must be a path to a CA bundle to use

  • cert – (optional) Any user-provided SSL certificate to be trusted.

  • proxies – (optional) The proxies dictionary to apply to the request.

qhana_plugin_runner.util.request_helpers.register_additional_schemas(session: Session)

Register adapters for the additional schemas in this module with a requests session.