weaver.status ============= .. py:module:: weaver.status Module Contents --------------- .. py:class:: StatusCompliant Utility :class:`enum.Enum` methods. Create an extended enum with these utilities as follows. .. code-block:: python class CustomEnum(ExtendedEnum): ItemA = "A" ItemB = "B" .. warning:: Must not define any enum value here to allow inheritance by subclasses. .. py:attribute:: OGC :value: 'OGC' .. py:attribute:: PYWPS :value: 'PYWPS' .. py:attribute:: OWSLIB :value: 'OWSLIB' .. py:attribute:: OPENEO :value: 'OPENEO' .. py:class:: StatusCategory Utility :class:`enum.Enum` methods. Create an extended enum with these utilities as follows. .. code-block:: python class CustomEnum(ExtendedEnum): ItemA = "A" ItemB = "B" .. warning:: Must not define any enum value here to allow inheritance by subclasses. .. py:attribute:: FINISHED :value: 'FINISHED' .. py:attribute:: RUNNING :value: 'RUNNING' .. py:attribute:: PENDING :value: 'PENDING' .. py:attribute:: FAILED :value: 'FAILED' .. py:attribute:: SUCCESS :value: 'SUCCESS' .. py:class:: Status Constants container that provides similar functionalities to :class:`ExtendedEnum` without explicit Enum membership. Initialize self. See help(type(self)) for accurate signature. .. py:attribute:: CREATED :type: Literal['created'] :value: 'created' .. py:attribute:: QUEUED :type: Literal['queued'] :value: 'queued' .. py:attribute:: ACCEPTED :type: Literal['accepted'] :value: 'accepted' .. py:attribute:: STARTED :type: Literal['started'] :value: 'started' .. py:attribute:: PAUSED :type: Literal['paused'] :value: 'paused' .. py:attribute:: SUCCEEDED :type: Literal['succeeded'] :value: 'succeeded' .. py:attribute:: SUCCESSFUL :type: Literal['successful'] :value: 'successful' .. py:attribute:: FAILED :type: Literal['failed'] :value: 'failed' .. py:attribute:: ERROR :type: Literal['error'] :value: 'error' .. py:attribute:: FINISHED :type: Literal['finished'] :value: 'finished' .. py:attribute:: RUNNING :type: Literal['running'] :value: 'running' .. py:attribute:: CANCELED :type: Literal['canceled'] :value: 'canceled' .. py:attribute:: DISMISSED :type: Literal['dismissed'] :value: 'dismissed' .. py:attribute:: EXCEPTION :type: Literal['exception'] :value: 'exception' .. py:attribute:: UNKNOWN :type: Literal['unknown'] :value: 'unknown' .. py:data:: JOB_STATUS_CATEGORIES .. py:data:: JOB_STATUS_CODE_API .. py:data:: JOB_STATUS_SEARCH_API .. py:data:: STATUS_PYWPS_MAP .. py:data:: STATUS_PYWPS_IDS .. py:data:: StatusType .. py:function:: map_status(wps_status: AnyStatusType) -> StatusType map_status(wps_status: AnyStatusType, compliant: StatusCompliant) -> StatusType map_status(wps_status: AnyStatusType, *, category: Any) -> StatusCategory Maps execution statuses between compatible values of different implementations. Mapping is supported for values from :mod:`weaver.status`, :mod:`OWSLib`, :mod:`pywps`, :term:`openEO`, as well as some specific one-of values of custom :term:`OAP` implementations. For each compliant combination, unsupported statuses are changed to corresponding ones with the closest logical match. Statuses are returned following :class:`Status` format. Specifically, this ensures statues are lowercase and not prefixed by ``Process`` (as in :term:`XML` response of :term:`OWS` :term:`WPS` like ``ProcessSucceeded`` for example). :param wps_status: One of :class:`Status` or its literal value to map to `compliant` standard. :param compliant: One of :class:`StatusCompliant` values. :param category: Request that the :class:`StatusCategory` corresponding to the supplied status is returned. :returns: Mapped status complying to the requested compliant category, or :data:`Status.UNKNOWN` if no match found.