πŸ”— Reference#

class meapi.Me(phone_number: Optional[Union[int, str]] = None, access_token: Optional[str] = None, activation_code: Optional[str] = None, credentials_manager: Optional[CredentialsManager] = None, new_account_details: Optional[NewAccountDetails] = None, interactive_mode: bool = False, session: Optional[Session] = None)#
The Me Client. Used to interact with MeAPI.
  • Source code: GitHub

  • See Setup to get started.

  • See Client for all the available methods.

Examples to setting up the client:

>>> from meapi import Me
>>> me = Me(phone_number=972123456789, activation_code='123456') # Unofficial method with pre-provided activation code.
>>> me = Me(interactive_mode=True) # With interactive mode (prompt for missing data instead of raising exceptions).
>>> me = Me(access_token='xxxxxxxxxxxx') # Official method, access token is required (saved in memory).
>>> me = Me(phone_number=972123456789, credentials_manager=RedisCredentialsManager(redis_con)) # With custom credentials manager.
>>> me = Me(phone_number=972123456789, activation_code='123456', new_account_details=NewAccountDetails(first_name='Chandler', last_name='Bing')) # New account registration.
Parameters:
  • interactive_mode (bool) – If True, the client will prompt for missing data instead of raising exceptions (See Interactive mode). Default: False.

  • phone_number (str | int | None) – International phone number format (Required on the Unofficial method). Default: None.

  • access_token (str | None) – Official access token (Required on the Official method). Default: None

  • activation_code (str | None) – Activation code (NeedActivationCode exception will be raised if not provided and interactive_mode is False). Default: None

  • credentials_manager (CredentialsManager | None) – Credentials manager to use in order to store and manage the credentials (See Credentials Manager). Default: JsonCredentialsManager.

  • new_account_details (NewAccountDetails | None) – Account details for new account registration without the need for a prompt (even if interactive_mode is True). Default: None.

  • session (requests.Session | None) – requests Session object. Default: None.

Raises: