Skip to content

Documentation for abc.py

sankaku.clients.abc.ABCHttpClient

Bases: ABC

Source code in sankaku/clients/abc.py
class ABCHttpClient(ABC):
    @abstractmethod
    def __init__(self, *args, **kwargs) -> None:
        """Abstract client for handling http requests."""
        pass

    async def __aenter__(self):
        return self

    async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
        await self.close()

    @abstractmethod
    def __del__(self) -> None:
        pass

    @abstractmethod
    async def close(self) -> None:
        """Close previously created client session."""

    @abstractmethod
    async def request(self, method: str, url: str, **kwargs) -> ClientResponse:
        """Make request to specified url."""

close() abstractmethod async

Close previously created client session.

Source code in sankaku/clients/abc.py
@abstractmethod
async def close(self) -> None:
    """Close previously created client session."""

request(method, url, **kwargs) abstractmethod async

Make request to specified url.

Source code in sankaku/clients/abc.py
@abstractmethod
async def request(self, method: str, url: str, **kwargs) -> ClientResponse:
    """Make request to specified url."""

sankaku.clients.abc.ABCClient

Bases: ABC

Source code in sankaku/clients/abc.py
class ABCClient(ABC):
    @abstractmethod
    def __init__(self, *args, **kwargs) -> None:
        """Abstract Sankaku client."""
        pass

    @abstractmethod
    async def login(
            self,
            *,
            access_token: Optional[str] = None,
            login: Optional[str] = None,
            password: Optional[str] = None
    ) -> None:
        """Login into sankakucomplex.com via access token or credentials."""

login(*, access_token=None, login=None, password=None) abstractmethod async

Login into sankakucomplex.com via access token or credentials.

Source code in sankaku/clients/abc.py
@abstractmethod
async def login(
        self,
        *,
        access_token: Optional[str] = None,
        login: Optional[str] = None,
        password: Optional[str] = None
) -> None:
    """Login into sankakucomplex.com via access token or credentials."""