Skip to content

Trust

A generic model for trust.

Trust

A generic model for trust.

Attributes

data: dict[str, Any] The raw data returned from the Ravy API. level: int From 0-6, higher is better, default is 3. label: str What the number means.

Source code in ravyapi/api/models/generic/trust.py
class Trust:
    """A generic model for trust.

    Attributes
    ----------
    data: dict[str, Any]
        The raw data returned from the Ravy API.
    level: int
        From 0-6, higher is better, default is 3.
    label: str
        What the number means.
    """

    __slots__: tuple[str, ...] = ("_data", "_level", "_label")

    def __init__(self, data: dict[str, Any]) -> None:
        self._data: dict[str, Any] = data
        self._level: int = data["level"]
        self._label: str = data["label"]

    def __repr__(self) -> str:
        return (
            f"{self.__class__.__module__}.{self.__class__.__qualname__}"
            f"(level={self.level!r}, label={self.label!r})"
        )

    @property
    def data(self) -> dict[str, Any]:
        """The raw data returned from the Ravy API."""
        return self._data

    @property
    def level(self) -> int:
        """From 0-6, higher is better, default is 3."""
        return self._level

    @property
    def label(self) -> str:
        """What the number means."""
        return self._label

data: dict[str, Any] property

The raw data returned from the Ravy API.

label: str property

What the number means.

level: int property

From 0-6, higher is better, default is 3.