weaver.datatype

Module Contents

weaver.datatype.LOGGER[source]
class weaver.datatype.Base[source]

Dictionary with extended attributes auto-getter/setter for convenience. Explicitly overridden getter/setter attributes are called instead of dict-key get/set-item to ensure corresponding checks and/or value adjustments are executed before applying it to the sub-dict.

Initialize self. See help(type(self)) for accurate signature.

property id(self)[source]
property uuid(self)[source]
abstract json(self)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.

abstract params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

class weaver.datatype.Service(*args, **kwargs)[source]

Dictionary that contains OWS services. It always has url key.

Initialize self. See help(type(self)) for accurate signature.

property id(self)[source]
property url(self)[source]

Service URL.

property name(self)[source]

Service name.

property type(self)[source]

Service type.

property public(self)[source]

Flag if service has public access.

property auth(self)[source]

Authentication method: public, token, cert.

json(self)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.

params(self)[source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

summary(self: pyramid.request.Request, request)Optional[JSON][source]
class weaver.datatype.Job(*args, **kwargs)[source]

Dictionary that contains OWS service jobs. It always has id and task_id keys.

Initialize self. See help(type(self)) for accurate signature.

inputs[source]
results[source]
exceptions[source]
logs[source]
tags[source]
_get_log_msg(self: Optional[str], msg: Optional[str] = None, status: Optional[Number] = None, progress=None)str[source]
static _get_err_msg(error: owslib.wps.WPSException)str[source]
save_log(self, errors: Optional[Union[str, Exception, WPSException, List[WPSException]]] = None, logger: Optional[Logger] = None, message: Optional[str] = None, level: int = INFO, status: Optional[str] = None, progress: Optional[Number] = None)None[source]

Logs the specified error and/or message, and adds the log entry to the complete job log.

For each new log entry, additional Job properties are added according to Job._get_log_msg() and the format defined by get_job_log_msg().

Parameters
  • errors – An error message or a list of WPS exceptions from which to log and save generated message stack.

  • logger – An additional Logger for which to propagate logged messages on top saving them to the job.

  • message – Explicit string to be logged, otherwise use the current Job.status_message is used.

  • level – Logging level to apply to the logged message. This parameter is ignored if errors are logged.

  • status – Override status applied in the logged message entry, but does not set it to the job object. Uses the current :prop:`Job.status` value if not specified. Must be one of Weaver.status values.

  • progress – Override progress applied in the logged message entry, but does not set it to the job object. Uses the current :prop:`Job.progress` value if not specified.

Note

The job object is updated with the log but still requires to be pushed to database to actually persist it.

property id(self)str[source]

Job UUID to retrieve the details from storage.

property task_id(self)Optional[str][source]

Reference Task UUID attributed by the Celery worker that monitors and executes this job.

property wps_id(self)Optional[str][source]

Reference WPS Request/Response UUID attributed by the executed PyWPS process.

This UUID matches the status-location, log and output directory of the WPS process. This parameter is only available when the process is executed on this local instance.

property service(self)Optional[str][source]

Service identifier of the corresponding remote process.

See also

property process(self)Optional[str][source]

Process identifier of the corresponding remote process.

See also

_get_inputs(self)List[Optional[Dict[str, Any]]][source]
_set_inputs(self: List[Optional[Dict[str, Any]]], inputs)None[source]
property user_id(self)Optional[str][source]
property status(self)str[source]
property status_message(self)str[source]
property status_location(self)Optional[str][source]
property notification_email(self)Optional[str][source]
property accept_language(self)Optional[str][source]
property execute_async(self)bool[source]
property is_local(self)bool[source]
property is_workflow(self)bool[source]
property created(self)datetime.datetime[source]
property finished(self)Optional[datetime][source]
is_finished(self)bool[source]
mark_finished(self)None[source]
property duration(self)datetime.timedelta[source]
property duration_str(self)str[source]
property progress(self)weaver.typedefs.Number[source]
_get_results(self)List[Optional[Dict[str, Any]]][source]
_set_results(self: List[Optional[Dict[str, Any]]], results)None[source]
_get_exceptions(self)List[Optional[Dict[str, str]]][source]
_set_exceptions(self: List[Optional[Dict[str, str]]], exceptions)None[source]
_get_logs(self)List[Dict[str, str]][source]
_set_logs(self: List[Dict[str, str]], logs)None[source]
_get_tags(self)List[Optional[str]][source]
_set_tags(self: List[Optional[str]], tags)None[source]
property access(self)str[source]

Job visibility access from execution.

property request(self)Optional[str][source]

XML request for WPS execution submission as string (binary).

property response(self)Optional[str][source]

XML status response from WPS execution submission as string (binary).

_job_url(self, settings)[source]
json(self: Optional[AnySettingsContainer], container=None)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

Settings are required to update API shortcut URLs to job additional information. Without them, paths will not include the API host, which will not resolve to full URI.

params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

class weaver.datatype.Process(*args, **kwargs)[source]

Dictionary that contains a process description for db storage. It always has identifier and processEndpointWPS1 keys.

Initialize self. See help(type(self)) for accurate signature.

_character_codes = [['$', '$'], ['.', '.']][source]
property id(self)str[source]
property identifier(self)str[source]
property title(self)str[source]
property abstract(self)str[source]
property keywords(self)List[str][source]
property metadata(self)List[str][source]
property version(self)Optional[str][source]
property inputs(self)Optional[List[Dict[str, Any]]][source]
property outputs(self)Optional[List[Dict[str, Any]]][source]
property jobControlOptions(self)Optional[List[str]][source]
property outputTransmission(self)Optional[List[str]][source]
property processDescriptionURL(self)Optional[str][source]
property processEndpointWPS1(self)Optional[str][source]
property executeEndpoint(self)Optional[str][source]
property owsContext(self)Optional[JSON][source]
property type(self)str[source]

Type of process amongst weaver.processes.types definitions.

property package(self)Optional[CWL][source]

Package CWL definition as JSON.

property payload(self)weaver.typedefs.JSON[source]

Deployment specification as JSON body.

static _recursive_replace(pkg: weaver.typedefs.JSON, index_from: int, index_to: int)weaver.typedefs.JSON[source]
static _encode(obj: Optional[JSON])Optional[JSON][source]
static _decode(obj: Optional[JSON])Optional[JSON][source]
property visibility(self)str[source]
params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

property params_wps(self)Dict[str, Any][source]

Values applicable to PyWPS Process __init__

json(self)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.

process_offering(self)weaver.typedefs.JSON[source]
process_summary(self)weaver.typedefs.JSON[source]
static from_wps(wps_process: pywps.Process, **extra_params: Any)weaver.datatype.Process[source]

Converts a pywps Process into a weaver.datatype.Process using provided parameters.

static from_ows(process: owslib.wps.Process, service: weaver.datatype.Service, container: weaver.typedefs.AnySettingsContainer, **kwargs: Any)weaver.datatype.Process[source]

Converts a owslib.wps Process to local storage weaver.datatype.Process.

static convert(process: weaver.typedefs.AnyProcess, service: Optional[Service] = None, container: Optional[AnySettingsContainer] = None, **kwargs: Any)weaver.datatype.Process[source]

Converts known process equivalents definitions into the formal datatype employed by Weaver.

wps(self)pywps.Process[source]

Converts this Process to a corresponding format understood by pywps.

class weaver.datatype.Quote(*args, **kwargs)[source]

Dictionary that contains quote information. It always has id and process keys.

Initialize self. See help(type(self)) for accurate signature.

property id(self)[source]

Quote ID.

property title(self)[source]

Quote title.

property description(self)[source]

Quote description.

property details(self)[source]

Quote details.

property user(self)[source]

User ID requesting the quote

property process(self)[source]

WPS Process ID.

property estimatedTime(self)[source]

Process estimated time.

property processParameters(self)[source]

Process execution parameters for quote.

property location(self)[source]

WPS Process URL.

property price(self)[source]

Price of the current quote

property currency(self)[source]

Currency of the quote price

property expire(self)[source]

Quote expiration datetime.

property created(self)[source]

Quote creation datetime.

property steps(self)[source]

Sub-quote IDs if applicable

params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

json(self)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.

class weaver.datatype.Bill(*args, **kwargs)[source]

Dictionary that contains bill information. It always has id, user, quote and job keys.

Initialize self. See help(type(self)) for accurate signature.

property id(self)[source]

Bill ID.

property user(self)[source]

User ID

property quote(self)[source]

Quote ID.

property job(self)[source]

Job ID.

property price(self)[source]

Price of the current quote

property currency(self)[source]

Currency of the quote price

property created(self)[source]

Quote creation datetime.

property title(self)[source]

Quote title.

property description(self)[source]

Quote description.

params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

json(self)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.