unofficial_tabdeal_api.base =========================== .. py:module:: unofficial_tabdeal_api.base .. autoapi-nested-parse:: This module holds the BaseClass. Classes ------- .. autoapisummary:: unofficial_tabdeal_api.base.BaseClass Module Contents --------------- .. py:class:: BaseClass(*, user_hash, authorization_key, _is_test = False) This is the base class, stores GET and POST functions. .. py:attribute:: _client_session :type: aiohttp.ClientSession .. py:attribute:: _logger :type: logging.Logger .. py:method:: close() :async: Close the aiohttp client session. .. py:method:: __aenter__() :async: Enter the async context manager. .. py:method:: __aexit__(exc_type, exc, tb) :async: Exit the async context manager and close the session. .. py:method:: _get_data_from_server(*, connection_url, queries = None) :async: Gets data from specified url and returns the parsed json back. :param connection_url: Url of the server to get data from :type connection_url: str :param queries: a Dictionary of queries. Defaults to None. :type queries: dict[str, Any] | None, optional :returns: a Dictionary or a list of dictionaries :rtype: dict[str, Any] | list[dict[str, Any]] .. py:method:: _post_data_to_server(*, connection_url, data) :async: Posts data to specified url and returns the result of request. :param connection_url: Url of server to post data to :type connection_url: str :param data: Stringed json data to send to server :type data: str :returns: A Dictionary or a list of dictionaries. :rtype: dict[str, Any] | list[dict[str, Any]] .. py:method:: _check_response(response) :async: Check the server response and raise appropriate exception in case of an error. :param response: Response from server :type response: ClientResponse :raises AuthorizationError: Raised when the authorization key is invalid or expired :raises Error: Raised for all other errors .. py:method:: _raise_specific_error(status_code, server_response) Raise a specific exception based on the server response content. :param status_code: The status code of the response :type status_code: int :param server_response: The content of the response :type server_response: str :raises exc_class: The specific exception class to raise :raises RequestError: Raised for all other errors