weaver.processes.utils

Module Contents

weaver.processes.utils.LOGGER[source]
weaver.processes.utils._get_data(output) → Optional[Any][source]

Extract the data from the output value.

weaver.processes.utils._read_reference(url) → Optional[AnyStr][source]

Read a reference HTTP(S) URL and return the content.

weaver.processes.utils._get_multi_json_references(output) → Optional[List[JSON]][source]

Since WPS standard does not allow to return multiple values for a single output, a lot of process actually return a json array containing references to these outputs. This function goal is to detect this particular format.

Returns:An array of HTTP(S) references if the specified output is effectively a JSON containing that, None otherwise.
weaver.processes.utils.map_progress(progress, range_min, range_max) → Number[source]

Calculates the relative progression of the percentage process within min/max values.

weaver.processes.utils.jsonify_output(output, process_description) → JSON[source]

Utility method to jsonify an output element from a WPS1 process description.

weaver.processes.utils.convert_process_wps_to_db(service, process, container) → ProcessDB[source]

Converts an owslib WPS Process to local storage Process.

weaver.processes.utils._check_deploy(payload)[source]

Validate minimum deploy payload field requirements with exception handling.

weaver.processes.utils._get_deploy_process_info(process_info, reference, package)[source]

Obtain the process definition from deploy payload with exception handling.

weaver.processes.utils.deploy_process_from_payload(payload, container) → HTTPException[source]

Adds a weaver.datatype.Process instance to storage using the provided JSON payload matching weaver.wps_restapi.swagger_definitions.ProcessDescription.

Returns:HTTPOk if the process registration was successful
Raises:HTTPException – otherwise
weaver.processes.utils.register_wps_processes_from_config(wps_processes_file_path, container) → None[source]

Loads a wps_processes.yml file and registers WPS-1 providers processes to the current Weaver instance as equivalent WPS-2 processes.

See also

  • weaver.wps_processes.yml.example for additional file format details