Module Contents

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, container) → 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.

Because the multi-output references are contained within this JSON file, it is not very convenient to retrieve the list of URLs as one always needs to open and read the file to get them. This function goal is to detect this particular format and expand the references to make them quickly available in the job output response.

Returns: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, container=None) → JSON[source]

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

In the case that a reference JSON output is specified and that it refers to a file that contains an array list of URL references to simulate a multiple-output, this specific output gets expanded to contain both the original URL reference field and the loaded URL list under data field for easier access from the response body.

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

Converts an owslib WPS Process to local storage Process.


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