Skip to content

⚡ Pullers#

This module contains all the classes and functions that make HTTP requests to the Mail.TM API (client- less). It is divided into two main classes:

  • get which is a synchronous class
  • xget which is an asynchronous class.

Each class has methods that correspond to the API endpoints.

  • These methods will take the necessary parameters and make a request to the corresponding endpoint.
  • The methods will return the response of the API in the form of a type hinteded object.
  • If the method returns None, it means that the request failed and the error is not explicitly handled by the method.

The methods of xget return None and the error is handled by the method itself, so you don't need to handle it.

All the methods in this module make requests to the API.

The methods in this module are also documented here.

get #

get()

A synchronous implementation which handles data client-less (without making a session).

Synchronous

Gets an out-of-client class that helps to fetch data regardless of account token. But this won't include all the data that is available in the API. It only pulls the data that is avilable without authentication using headers.

create_account #

create_account(
    address: str, password: str
) -> t.Optional[Account]

Creates an account.

PARAMETER DESCRIPTION
address

The email address of the new account.

TYPE: str

password

The password for the new account.

TYPE: str

RETURNS DESCRIPTION
Optional[Account]

The newly created account object if successful, None otherwise.

get_account #

get_account(account_id: str) -> t.Optional[Account]

Gets an account using ID.

PARAMETER DESCRIPTION
account_id

The ID of the account to get.

TYPE: str

RETURNS DESCRIPTION
Optional[Account]

The account object if successful, None otherwise.

delete_account #

delete_account(account_id: str) -> bool

Deletes an account using ID.

PARAMETER DESCRIPTION
account_id

The ID of the account to delete.

TYPE: str

RETURNS DESCRIPTION
bool

True if successful, False otherwise.

get_account_token #

get_account_token(
    account_address: str, account_password: str
) -> t.Optional[Token]

Get an account token which is used by the clients.

PARAMETER DESCRIPTION
account_address

The email address of the account.

TYPE: str

account_password

The password of the account.

TYPE: str

RETURNS DESCRIPTION
Optional[Token]

The account token if successful, None otherwise.

get_domain #

get_domain(domain_id: str) -> t.Optional[Domain]

Get a specific domain with ID.

PARAMETER DESCRIPTION
domain_id

The ID of the domain to get.

TYPE: str

RETURNS DESCRIPTION
Optional[Domain]

The domain with the ID provided. If not found, returns None.

get_domains #

get_domains() -> t.Optional[DomainPageView]

Get all domains.

RETURNS DESCRIPTION
Optional[DomainPageView]

The domain page view if successful, None otherwise.

xget #

xget()

An asynchronous implementation which handles data client-less (without making a session).

Asynchronous

Gets an out-of-client class that helps to fetch data regardless of account token. But this won't include all the data that is available in the API. It only pulls the data that is avilable without authentication using headers.

create_account async #

create_account(
    address: str, password: str
) -> t.Optional[Account]

Creates an account.

PARAMETER DESCRIPTION
address

The email address of the new account.

TYPE: str

password

The password for the new account.

TYPE: str

RETURNS DESCRIPTION
Optional[Account]

The newly created account object if successful, None otherwise.

get_account async #

get_account(account_id: str) -> t.Optional[Account]

Gets an account using ID.

PARAMETER DESCRIPTION
account_id

The ID of the account to get.

TYPE: str

RETURNS DESCRIPTION
Optional[Account]

The account object if successful, None otherwise.

delete_account async #

delete_account(account_id: str) -> None

Deletes an account using ID.

PARAMETER DESCRIPTION
account_id

The ID of the account to delete.

TYPE: str

RETURNS DESCRIPTION
None

get_account_token async #

get_account_token(
    account_address: str, account_password: str
) -> t.Optional[Token]

Get an account token which is used by the clients.

PARAMETER DESCRIPTION
account_address

The email address of the account.

TYPE: str

account_password

The password of the account.

TYPE: str

RETURNS DESCRIPTION
Optional[Token]

The account token if successful, None otherwise.

get_domain async #

get_domain(domain_id: str) -> t.Optional[Domain]

Get a specific domain with ID.

PARAMETER DESCRIPTION
domain_id

The ID of the domain to get.

TYPE: str

RETURNS DESCRIPTION
Optional[Domain]

The domain with the ID provided. If not found, returns None.

get_domains async #

get_domains() -> t.Optional[DomainPageView]

Get all domains.

RETURNS DESCRIPTION
Optional[DomainPageView]

The domain page view if successful, None otherwise.