Skip to content

rs_client/stac/prip_client.md

<< Back to index

PripClient class implementation.

PripClient

Bases: StacBase

PripClient class implementation.

Attributes: see :py:class:RsClient

Source code in docs/rs-client-libraries/rs_client/stac/prip_client.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
class PripClient(StacBase):
    """
    PripClient class implementation.

    Attributes: see :py:class:`RsClient`
    """

    def __init__(  # pylint: disable=too-many-arguments, too-many-positional-arguments
        self,
        rs_server_href: str | None,
        rs_server_api_key: str | None,
        logger: logging.Logger | None = None,
        **kwargs: dict[str, Any],
    ):
        """
        Initializes an PripClient instance.

        Args:
            rs_server_href (str | None): The URL of the RS-Server. Pass None for local mode.
            rs_server_api_key (str | None): API key for authentication.
            logger (logging.Logger | None, optional): Logger instance (default: None).
            **kwargs: Arbitrary keyword arguments that may include:
                - `headers` (Optional[Dict[str, str]])
                - `parameters` (Optional[Dict[str, Any]])
                - `ignore_conformance` (Optional[bool])
                - `modifier` (Callable[[Collection | Item | ItemCollection | dict[Any, Any]], None] | None)
                - `request_modifier` (Optional[Callable[[Request], Union[Request, None]]])
                - `stac_io` (Optional[StacApiIO])
                - `timeout` (Optional[Timeout])
        """
        super().__init__(
            rs_server_href,
            rs_server_api_key,
            None,
            logger,
            get_href_service(rs_server_href, "RSPY_HOST_PRIP") + "/prip/",
            **kwargs,
        )

    @property
    def href_service(self) -> str:
        """
        Return the RS-Server PRIP URL hostname.
        This URL can be overwritten using the RSPY_HOST_PRIP env variable (used e.g. for local mode).
        Otherwise it should just be the RS-Server URL.
        """
        return get_href_service(self.rs_server_href, "RSPY_HOST_PRIP") + "/prip"

href_service property

Return the RS-Server PRIP URL hostname. This URL can be overwritten using the RSPY_HOST_PRIP env variable (used e.g. for local mode). Otherwise it should just be the RS-Server URL.

__init__(rs_server_href, rs_server_api_key, logger=None, **kwargs)

Initializes an PripClient instance.

Parameters:

Name Type Description Default
rs_server_href str | None

The URL of the RS-Server. Pass None for local mode.

required
rs_server_api_key str | None

API key for authentication.

required
logger Logger | None

Logger instance (default: None).

None
**kwargs dict[str, Any]

Arbitrary keyword arguments that may include: - headers (Optional[Dict[str, str]]) - parameters (Optional[Dict[str, Any]]) - ignore_conformance (Optional[bool]) - modifier (Callable[[Collection | Item | ItemCollection | dict[Any, Any]], None] | None) - request_modifier (Optional[Callable[[Request], Union[Request, None]]]) - stac_io (Optional[StacApiIO]) - timeout (Optional[Timeout])

{}
Source code in docs/rs-client-libraries/rs_client/stac/prip_client.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def __init__(  # pylint: disable=too-many-arguments, too-many-positional-arguments
    self,
    rs_server_href: str | None,
    rs_server_api_key: str | None,
    logger: logging.Logger | None = None,
    **kwargs: dict[str, Any],
):
    """
    Initializes an PripClient instance.

    Args:
        rs_server_href (str | None): The URL of the RS-Server. Pass None for local mode.
        rs_server_api_key (str | None): API key for authentication.
        logger (logging.Logger | None, optional): Logger instance (default: None).
        **kwargs: Arbitrary keyword arguments that may include:
            - `headers` (Optional[Dict[str, str]])
            - `parameters` (Optional[Dict[str, Any]])
            - `ignore_conformance` (Optional[bool])
            - `modifier` (Callable[[Collection | Item | ItemCollection | dict[Any, Any]], None] | None)
            - `request_modifier` (Optional[Callable[[Request], Union[Request, None]]])
            - `stac_io` (Optional[StacApiIO])
            - `timeout` (Optional[Timeout])
    """
    super().__init__(
        rs_server_href,
        rs_server_api_key,
        None,
        logger,
        get_href_service(rs_server_href, "RSPY_HOST_PRIP") + "/prip/",
        **kwargs,
    )