Skip to content

Client

DriftAlertRequest

Source code in python/scouter/client/_client.pyi
class DriftAlertRequest:
    def __init__(
        self,
        name: str,
        space: str,
        version: str,
        active: bool = False,
        limit_datetime: Optional[datetime.datetime] = None,
        limit: Optional[int] = None,
    ) -> None:
        """Initialize drift alert request

        Args:
            name:
                Name
            space:
                Space
            version:
                Version
            active:
                Whether to get active alerts only
            limit_datetime:
                Limit datetime for alerts
            limit:
                Limit for number of alerts to return
        """

__init__(name, space, version, active=False, limit_datetime=None, limit=None)

Initialize drift alert request

Parameters:

Name Type Description Default
name str

Name

required
space str

Space

required
version str

Version

required
active bool

Whether to get active alerts only

False
limit_datetime Optional[datetime]

Limit datetime for alerts

None
limit Optional[int]

Limit for number of alerts to return

None
Source code in python/scouter/client/_client.pyi
def __init__(
    self,
    name: str,
    space: str,
    version: str,
    active: bool = False,
    limit_datetime: Optional[datetime.datetime] = None,
    limit: Optional[int] = None,
) -> None:
    """Initialize drift alert request

    Args:
        name:
            Name
        space:
            Space
        version:
            Version
        active:
            Whether to get active alerts only
        limit_datetime:
            Limit datetime for alerts
        limit:
            Limit for number of alerts to return
    """

DriftRequest

Source code in python/scouter/client/_client.pyi
class DriftRequest:
    def __init__(
        self,
        name: str,
        space: str,
        version: str,
        time_interval: TimeInterval,
        max_data_points: int,
        drift_type: DriftType,
    ) -> None:
        """Initialize drift request

        Args:
            name:
                Model name
            space:
                Model space
            version:
                Model version
            time_interval:
                Time window for drift request
            max_data_points:
                Maximum data points to return
            drift_type:
                Drift type for request
        """

__init__(name, space, version, time_interval, max_data_points, drift_type)

Initialize drift request

Parameters:

Name Type Description Default
name str

Model name

required
space str

Model space

required
version str

Model version

required
time_interval TimeInterval

Time window for drift request

required
max_data_points int

Maximum data points to return

required
drift_type DriftType

Drift type for request

required
Source code in python/scouter/client/_client.pyi
def __init__(
    self,
    name: str,
    space: str,
    version: str,
    time_interval: TimeInterval,
    max_data_points: int,
    drift_type: DriftType,
) -> None:
    """Initialize drift request

    Args:
        name:
            Model name
        space:
            Model space
        version:
            Model version
        time_interval:
            Time window for drift request
        max_data_points:
            Maximum data points to return
        drift_type:
            Drift type for request
    """

GetProfileRequest

Source code in python/scouter/client/_client.pyi
class GetProfileRequest:
    def __init__(self, name: str, space: str, version: str, drift_type: DriftType) -> None:
        """Initialize get profile request

        Args:
            name:
                Profile name
            space:
                Profile space
            version:
                Profile version
            drift_type:
                Profile drift type. A (repo/name/version can be associated with more than one drift type)
        """

__init__(name, space, version, drift_type)

Initialize get profile request

Parameters:

Name Type Description Default
name str

Profile name

required
space str

Profile space

required
version str

Profile version

required
drift_type DriftType

Profile drift type. A (repo/name/version can be associated with more than one drift type)

required
Source code in python/scouter/client/_client.pyi
def __init__(self, name: str, space: str, version: str, drift_type: DriftType) -> None:
    """Initialize get profile request

    Args:
        name:
            Profile name
        space:
            Profile space
        version:
            Profile version
        drift_type:
            Profile drift type. A (repo/name/version can be associated with more than one drift type)
    """

HTTPConfig

Source code in python/scouter/client/_client.pyi
class HTTPConfig:
    server_uri: str
    username: str
    password: str
    auth_token: str

    def __init__(
        self,
        server_uri: Optional[str] = None,
        username: Optional[str] = None,
        password: Optional[str] = None,
        auth_token: Optional[str] = None,
    ) -> None:
        """HTTP configuration to use with the HTTPProducer.

        Args:
            server_uri:
                URL of the HTTP server to publish messages to.
                If not provided, the value of the HTTP_server_uri environment variable is used.

            username:
                Username for basic authentication.

            password:
                Password for basic authentication.

            auth_token:
                Authorization token to use for authentication.

        """

__init__(server_uri=None, username=None, password=None, auth_token=None)

HTTP configuration to use with the HTTPProducer.

Parameters:

Name Type Description Default
server_uri Optional[str]

URL of the HTTP server to publish messages to. If not provided, the value of the HTTP_server_uri environment variable is used.

None
username Optional[str]

Username for basic authentication.

None
password Optional[str]

Password for basic authentication.

None
auth_token Optional[str]

Authorization token to use for authentication.

None
Source code in python/scouter/client/_client.pyi
def __init__(
    self,
    server_uri: Optional[str] = None,
    username: Optional[str] = None,
    password: Optional[str] = None,
    auth_token: Optional[str] = None,
) -> None:
    """HTTP configuration to use with the HTTPProducer.

    Args:
        server_uri:
            URL of the HTTP server to publish messages to.
            If not provided, the value of the HTTP_server_uri environment variable is used.

        username:
            Username for basic authentication.

        password:
            Password for basic authentication.

        auth_token:
            Authorization token to use for authentication.

    """

ProfileStatusRequest

Source code in python/scouter/client/_client.pyi
class ProfileStatusRequest:
    def __init__(self, name: str, space: str, version: str, drift_type: DriftType, active: bool) -> None:
        """Initialize profile status request

        Args:
            name:
                Model name
            space:
                Model space
            version:
                Model version
            drift_type:
                Profile drift type. A (repo/name/version can be associated with more than one drift type)
            active:
                Whether to set the profile as active or inactive
        """

__init__(name, space, version, drift_type, active)

Initialize profile status request

Parameters:

Name Type Description Default
name str

Model name

required
space str

Model space

required
version str

Model version

required
drift_type DriftType

Profile drift type. A (repo/name/version can be associated with more than one drift type)

required
active bool

Whether to set the profile as active or inactive

required
Source code in python/scouter/client/_client.pyi
def __init__(self, name: str, space: str, version: str, drift_type: DriftType, active: bool) -> None:
    """Initialize profile status request

    Args:
        name:
            Model name
        space:
            Model space
        version:
            Model version
        drift_type:
            Profile drift type. A (repo/name/version can be associated with more than one drift type)
        active:
            Whether to set the profile as active or inactive
    """

ScouterClient

Helper client for interacting with Scouter Server

Source code in python/scouter/client/_client.pyi
class ScouterClient:
    """Helper client for interacting with Scouter Server"""

    def __init__(self, config: Optional[HTTPConfig] = None) -> None:
        """Initialize ScouterClient

        Args:
            config:
                HTTP configuration for interacting with the server.
        """

    def get_binned_drift(self, drift_request: DriftRequest) -> Any:
        """Get drift map from server

        Args:
            drift_request:
                DriftRequest object

        Returns:
            Drift map of type BinnedCustomMetrics | BinnedPsiFeatureMetrics | BinnedSpcFeatureMetrics
        """

    def register_profile(self, profile: Any, set_active: bool = False) -> bool:
        """Registers a drift profile with the server

        Args:
            profile:
                Drift profile
            set_active:
                Whether to set the profile as active or inactive

        Returns:
            boolean
        """

    def update_profile_status(self, request: ProfileStatusRequest) -> bool:
        """Update profile status

        Args:
            request:
                ProfileStatusRequest

        Returns:
            boolean
        """

    def get_alerts(self, request: DriftAlertRequest) -> List[Alert]:
        """Get alerts

        Args:
            request:
                DriftAlertRequest

        Returns:
            List[Alert]
        """

    def download_profile(self, request: GetProfileRequest, path: Optional[Path]) -> str:
        """Download profile

        Args:
            request:
                GetProfileRequest
            path:
                Path to save profile

        Returns:
            Path to downloaded profile
        """

__init__(config=None)

Initialize ScouterClient

Parameters:

Name Type Description Default
config Optional[HTTPConfig]

HTTP configuration for interacting with the server.

None
Source code in python/scouter/client/_client.pyi
def __init__(self, config: Optional[HTTPConfig] = None) -> None:
    """Initialize ScouterClient

    Args:
        config:
            HTTP configuration for interacting with the server.
    """

download_profile(request, path)

Download profile

Parameters:

Name Type Description Default
request GetProfileRequest

GetProfileRequest

required
path Optional[Path]

Path to save profile

required

Returns:

Type Description
str

Path to downloaded profile

Source code in python/scouter/client/_client.pyi
def download_profile(self, request: GetProfileRequest, path: Optional[Path]) -> str:
    """Download profile

    Args:
        request:
            GetProfileRequest
        path:
            Path to save profile

    Returns:
        Path to downloaded profile
    """

get_alerts(request)

Get alerts

Parameters:

Name Type Description Default
request DriftAlertRequest

DriftAlertRequest

required

Returns:

Type Description
List[Alert]

List[Alert]

Source code in python/scouter/client/_client.pyi
def get_alerts(self, request: DriftAlertRequest) -> List[Alert]:
    """Get alerts

    Args:
        request:
            DriftAlertRequest

    Returns:
        List[Alert]
    """

get_binned_drift(drift_request)

Get drift map from server

Parameters:

Name Type Description Default
drift_request DriftRequest

DriftRequest object

required

Returns:

Type Description
Any

Drift map of type BinnedCustomMetrics | BinnedPsiFeatureMetrics | BinnedSpcFeatureMetrics

Source code in python/scouter/client/_client.pyi
def get_binned_drift(self, drift_request: DriftRequest) -> Any:
    """Get drift map from server

    Args:
        drift_request:
            DriftRequest object

    Returns:
        Drift map of type BinnedCustomMetrics | BinnedPsiFeatureMetrics | BinnedSpcFeatureMetrics
    """

register_profile(profile, set_active=False)

Registers a drift profile with the server

Parameters:

Name Type Description Default
profile Any

Drift profile

required
set_active bool

Whether to set the profile as active or inactive

False

Returns:

Type Description
bool

boolean

Source code in python/scouter/client/_client.pyi
def register_profile(self, profile: Any, set_active: bool = False) -> bool:
    """Registers a drift profile with the server

    Args:
        profile:
            Drift profile
        set_active:
            Whether to set the profile as active or inactive

    Returns:
        boolean
    """

update_profile_status(request)

Update profile status

Parameters:

Name Type Description Default
request ProfileStatusRequest

ProfileStatusRequest

required

Returns:

Type Description
bool

boolean

Source code in python/scouter/client/_client.pyi
def update_profile_status(self, request: ProfileStatusRequest) -> bool:
    """Update profile status

    Args:
        request:
            ProfileStatusRequest

    Returns:
        boolean
    """