birdy.client.base module

class birdy.client.base.WPSClient(url, processes=None, converters=None, username=None, password=None, headers=None, auth=None, verify=True, cert=None, progress=False, version=owslib.wps.WPS_DEFAULT_VERSION, caps_xml=None, desc_xml=None, language=None, lineage=False, **kwds)[source]

Bases: object

Returns a class where every public method is a WPS process available at the given url.

Parameters:
  • url (str) – Link to WPS provider. config (Config): an instance.

  • processes (any, optional) – Specify a subset of processes to bind. Defaults to all processes.

  • converters (dict, optional) – Correspondence of {mimetype: class} to convert this mimetype to a python object.

  • username (str, optional) – Passed to owslib.wps.WebProcessingService.

  • password (str, optional) – Passed to owslib.wps.WebProcessingService.

  • headers (str, optional) – Passed to owslib.wps.WebProcessingService.

  • auth (requests.auth.AuthBase) – Requests-style auth class to authenticate. See https://2.python-requests.org/en/master/user/authentication/.

  • verify (bool) – Passed to owslib.wps.WebProcessingService.

  • cert (str) – Passed to owslib.wps.WebProcessingService.

  • progress (bool) – If True, enable interactive user mode.

  • version (str) – WPS version to use.

  • caps_xml (str) – A WPS GetCapabilities response for testing.

  • desc_xml (str) – A WPS DescribeProcess response with “identifier=all” for testing.

  • language (str) – Passed to owslib.wps.WebProcessingService (e.g. ‘fr-CA’, ‘en_US’).

  • lineage (bool) – If True, the Execute operation includes lineage information.

  • **kwds (dict) – Passed to owslib.wps.WebProcessingService.

Examples

>>> emu = WPSClient(url='<server url>')
>>> emu.hello('stranger')
'Hello stranger'
_build_inputs(pid, **kwargs)[source]

Build the input sequence from the function arguments.

_console_monitor(execution: owslib.wps.WPSExecution, sleep: int = 3)[source]

Monitor the execution of a process.

Parameters:
  • execution (WPSExecution) – The execute response to monitor.

  • sleep (int) – Number of seconds to wait before each status check.

_execute(pid, **kwargs)[source]

Execute the process.

_get_process_description(processes=None, xml=None)[source]

Return the description for each process.

Sends the server a describeProcess request for each process.

Parameters:

processes (str, list, None) – A process name, a list of process names or None (for all processes).

Returns:

A dictionary keyed by the process identifier of process descriptions.

Return type:

OrderedDict

_method_factory(pid: str) Callable[source]

Create a custom function signature with docstring, instantiate it and pass it to a wrapper.

The wrapper will call the process on reception.

Parameters:

pid (str) – Identifier of the WPS process.

Returns:

A Python function calling the remote process, complete with docstring and signature.

Return type:

func

_parse_output_formats(outputs)[source]

Parse an output format dictionary into a list of tuples, as required by wps.execute().

_setup_logging()[source]
property language
property languages
birdy.client.base.nb_form(wps: WPSClient, pid: str) None[source]

Return a Notebook form to enter input values and launch process.

Parameters:
  • wps (WPSClient) – The WPS client.

  • pid (str) – The process identifier.

birdy.client.base.sort_inputs_key(i: owslib.wps.Input)[source]

Key function for sorting process inputs.

The order is:
  • Inputs that have minOccurs >= 1 and no default value

  • Inputs that have minOccurs >= 1 and a default value

  • Every other input

Parameters:

i (owslib.wps.Input) – An owslib Input.

Notes

The defaultValue for ComplexData is ComplexData instance specifying mimetype, encoding and schema.