Python Reference
Generating RSA Keys
Synchronous API
- class reusable.email.Sync(authorization: str, private_key: bytes | None = None)[source]
Bases:
object
Manages a synchronized session with the API.
Methods
General inboxes
- view_inbox(alias: str, after: str | None = None) list[reusable.email.types.Email] | Response [source]
View the content of an inbox.
Encrypted inboxes
- create_encrypted_inbox(alias: str, public_key: bytes) bool | Response [source]
Create a new encrypted inbox.
- view_encrypted_inbox(alias: str, after: str | None = None) list[reusable.email.types.Email] | Response [source]
View the content of an inbox.
- fetch_encrypted_email(alias: str, email_id: str) Email | Response [source]
Fetch a specific email from the inbox.
- delete_encrypted_email(alias: str, email_id: str) bool | Response [source]
Delete a specific email from the inbox.
- create_encrypted_inbox(alias: str, public_key: bytes) bool | Response [source]
Create a new encrypted inbox.
- delete_email(alias: str, email_id: str) bool | Response [source]
Delete a specific email from the inbox.
- delete_encrypted_email(alias: str, email_id: str) bool | Response [source]
Delete a specific email from the inbox.
- fetch_email_body(alias: str, email_id: str) str | Response [source]
Fetch a specific email’s body from the inbox.
- fetch_encrypted_email(alias: str, email_id: str) Email | Response [source]
Fetch a specific email from the inbox.
- generate_session(authorization: str) None [source]
Initialize the API session with the necessary headers.
- static json_or_text(response: Response) Dict[str, Any] | str [source]
Extract JSON or text response from an HTTP response.
- request(route: Route, headers: Dict[str, str] | None = None, params: Dict[str, str] | None = None, json: Dict[str, Any] | None = None, data: Dict[str, Any] | None = None) Response [source]
Send an HTTP request based on the given route and parameters.
Asynchronous API
- class reusable.email.Async(authorization: str, private_key: bytes | None = None)[source]
Bases:
object
Manages an asynchronous session with the API.
Methods
Session related methods
General inboxes
- async view_inbox(alias: str, after: str | None = None) list[reusable.email.types.Email] | ClientResponse [source]
View the content of an inbox.
Encrypted inboxes
- async create_encrypted_inbox(alias: str, public_key: bytes) bool | ClientResponse [source]
Create a new encrypted inbox.
- async view_encrypted_inbox(alias: str, after: str | None = None) list[reusable.email.types.Email] | ClientResponse [source]
View the content of an inbox.
- async fetch_encrypted_email(alias: str, email_id: str) Email | ClientResponse [source]
Fetch a specific email from the inbox.
- async delete_encrypted_email(alias: str, email_id: str) bool | ClientResponse [source]
Delete a specific email from the inbox.
- async create_encrypted_inbox(alias: str, public_key: bytes) bool | ClientResponse [source]
Create a new encrypted inbox.
- async delete_email(alias: str, email_id: str) bool | ClientResponse [source]
Delete a specific email from the inbox.
- async delete_encrypted_email(alias: str, email_id: str) bool | ClientResponse [source]
Delete a specific email from the inbox.
- async fetch_email_body(alias: str, email_id: str) str | ClientResponse [source]
Fetch a specific email from the inbox.
- async fetch_encrypted_email(alias: str, email_id: str) Email | ClientResponse [source]
Fetch a specific email from the inbox.
- async static json_or_text(response: ClientResponse) Dict[str, Any] | str [source]
Extract JSON or text response from an HTTP response.
- async request(route: Route, headers: Dict[str, str] | None = None, params: Dict[str, str] | None = None, json: Dict[str, Any] | None = None, data: Dict[str, Any] | None = None) ClientResponse [source]
Send an asynchronous HTTP request based on the given route and parameters.