weaver.execute

Module Contents

weaver.execute.ExecutionModeAutoType[source]
weaver.execute.LOGGER[source]
class weaver.execute.ExecuteMode[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

AUTO: ExecutionModeAutoType = 'auto'[source]
ASYNC: ExecutionModeAsyncType = 'async'[source]
SYNC: ExecutionModeSyncType = 'sync'[source]
class weaver.execute.ExecuteControlOption[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

ASYNC: ExecuteControlOptionAsyncType = 'async-execute'[source]
SYNC: ExecuteControlOptionSyncType = 'sync-execute'[source]
classmethod values() List[AnyExecuteControlOption][source]

Return default control options in specific order according to preferred modes for execution by Weaver.

class weaver.execute.ExecuteReturnPreference[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

MINIMAL: ExecuteReturnPreferenceMinimalType = 'minimal'[source]
REPRESENTATION: ExecuteReturnPreferenceRepresentationType = 'representation'[source]
class weaver.execute.ExecuteResponse[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

RAW: ExecuteResponseRawType = 'raw'[source]
DOCUMENT: ExecuteResponseDocumentType = 'document'[source]
class weaver.execute.ExecuteTransmissionMode[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

VALUE: ExecuteTransmissionModeValueType = 'value'[source]
REFERENCE: ExecuteTransmissionModeReferenceType = 'reference'[source]
class weaver.execute.ExecuteCollectionFormat[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

STAC: ExecuteCollectionFormatType_STAC = 'stac-collection'[source]
OGC_COVERAGE: ExecuteCollectionFormatType_OGC_COVERAGE = 'ogc-coverage-collection'[source]
OGC_FEATURES: ExecuteCollectionFormatType_OGC_FEATURES = 'ogc-features-collection'[source]
OGC_MAP: ExecuteCollectionFormatType_OGC_MAP = 'ogc-map-collection'[source]
GEOJSON: ExecuteCollectionFormatType_GEOJSON = 'geojson-feature-collection'[source]
weaver.execute.parse_prefer_header_return(headers: weaver.typedefs.AnyHeadersContainer) AnyExecuteReturnPreference | None[source]

Get the return preference if specified.

weaver.execute.parse_prefer_header_execute_mode(header_container: weaver.typedefs.AnyHeadersContainer, supported_modes: List[AnyExecuteControlOption] | None = None, wait_max: int = 10) Tuple[AnyExecuteMode, int | None, weaver.typedefs.HeadersType][source]

Obtain execution preference if provided in request headers.

See also

See also

If Prefer format is valid, but server decides it cannot be respected, it can be transparently ignored (RFC 7240#section-2). The server must respond with Preference-Applied indicating preserved preferences it decided to respect.

Parameters:
  • header_container – Request headers to retrieve preference, if any available.

  • supported_modes – Execute modes that are permitted for the operation that received the Prefer header. Resolved mode will respect this constraint following specification requirements of OGC API - Processes.

  • wait_max – Maximum wait time enforced by the server. If requested wait time is greater, wait preference will not be applied and will fall back to asynchronous response.

Returns:

Tuple of resolved execution mode, wait time if specified, and header of applied preferences if possible. Maximum wait time indicates duration until synchronous response should fall back to asynchronous response.

Raises:

HTTPBadRequest – If contents of Prefer are not valid.

weaver.execute.update_preference_applied_return_header(job: weaver.datatype.Job, request_headers: weaver.typedefs.AnyHeadersContainer | None, response_headers: weaver.typedefs.AnyHeadersContainer | None) weaver.typedefs.AnyHeadersContainer[source]

Updates the Preference-Applied header according to available information.

Parameters:
  • job – Job where the desired return preference has be resolved.

  • request_headers – Original request headers, to look for any Prefer: return.

  • response_headers – Already generated response headers, to extend Preference-Applied header as needed.

Returns:

Updated response headers with any resolved return preference.