Welcome to Malix’s documentation!¶
Intoduction¶
Malix - an API for generating disposable e-mails.
Installing¶
This library is available in PyPI, and you can get it by pip using the following command.:
py -m pip install -U malix-rin
Or you can clone the source code by git using the following commnad.:
git clone https://github.com/sunilswain/Malix
then go to same directory as MalixMail and run setup.py using this command.:
py setup.py install
malix¶
malix package¶
Subpackages¶
malix.utils package¶
Submodules¶
-
malix.utils.Methods.
delete_account
(Id, token: str)¶ Deletes the account resource.
-
malix.utils.Methods.
delete_message
(Id: str, token: str)¶ Deletes the message resource.
-
malix.utils.Methods.
download_message
(Id: str, token: str, path: Optional[str] = None)¶ Downloads the message.
-
malix.utils.Methods.
get_account
(Id: str, token: str)¶ Retrives the resource of an account.
-
malix.utils.Methods.
get_domain
(Id: str)¶ Retrives resource of a specific domain id.
-
malix.utils.Methods.
get_domain_collection
(domains_only: bool = False)¶ Retrives collection of domains.
-
malix.utils.Methods.
get_message
(Id: str, token: str)¶ Retrives the available messages for the respective source.
-
malix.utils.Methods.
get_message_collection
(token: str)¶ Retrives the collection resource.
-
malix.utils.Methods.
get_my_account
(token: str)¶ Retrives the resource for an logged in account.
-
malix.utils.Methods.
get_sources
(Id: str, token: str)¶ Returns the available sources for the respective Id.
-
malix.utils.Methods.
make_account
(address: Optional[str] = None, password: Optional[str] = None)¶ Creates a resource for an account.
-
malix.utils.Methods.
update_message
(Id: str, token: str)¶ Updates message resource.
-
class
malix.utils.attributes.
Account
(data: dict)¶ -
json
¶ Formatted reponse(str).
-
response
¶ Raw response(dict).
-
id
¶ Id of the account.
-
adress
¶ Adress of the account.
-
isDisabled
¶ Tells whether the account is disabled or not.
-
isDeleted
¶ Tells whether the account is deleted or not.
-
quota
¶ Honestly, don’t know.! may become useful in the future.
-
used
¶ Tells how many times used.
-
createdAt
¶ Tells when the account resource was created.
-
updatedAt
¶ Tells when the account resource was updated.
-
-
class
malix.utils.attributes.
Domain
(data: dict)¶ -
json
¶ Formatted reponse(str).
-
response
¶ Raw response(dict).
-
id
¶ Id of the domain.
-
isActive
¶ Tells whether the domain is still active or not.
-
isPrivate
¶ Tells whether the domain has been protected or not.
-
createdAt
¶ Tells when the domain resource was created.
-
updatedAt
¶ Tells when the domain resource was updated.
-
-
class
malix.utils.attributes.
Message
(data: dict)¶ -
json
¶ Formatted reponse(str).
-
response
¶ Raw response(dict).
-
id
¶ Id of the message.
-
accountId
¶ Account id of the cleint.
-
From
¶ Dictonary containing address and name of the sender.
-
To
¶ Dictonary containing address and name(will be hidden) of the receiver.
-
CC
¶ don’t know ¯_(ツ)_/¯
-
BCC
¶ don’t know ¯_(ツ)_/¯
-
subject
¶ subject of the message.
-
seen
¶ True if seen is updated using
update_message
.
-
flagged
¶ Tells whether the message has been flagged or not.
-
isDeleted
¶ True if the message resource has been deleted.
-
verifications
¶ verifications list.
-
retention
¶ True if the message is still retained.
-
retentionDate
¶ The date of retention.
-
text
¶ Text of the message.
-
html
¶ html of the message.
-
hasAttachments
¶ True if the message contains attachments.
-
attachments
¶ The attachments of the message.
-
size
¶ size of the message in Bytes.
-
downloadUrl
¶ The download url of the message.
-
createdAt
¶ Tells when the message resource was created.
-
updatedAt
¶ Tells when the message resource was updated.
-
-
exception
malix.utils.exceptions.
AccessDenied
(*args)¶ Bases:
Exception
Raises when the client doesn’t have the rights to perform some specific operations.
code: 403
-
exception
malix.utils.exceptions.
Error
(*args)¶ Bases:
Exception
Base class of Error.
-
exception
malix.utils.exceptions.
InvalidCredentials
(*args)¶ Bases:
malix.utils.exceptions.Error
Raises when given credentials are invalid.
code: 401
-
exception
malix.utils.exceptions.
InvalidInput
(*args)¶ Bases:
malix.utils.exceptions.Error
Raises when either address or password is invalid.
code: 400
-
exception
malix.utils.exceptions.
NotAuthorized
(*args)¶ Bases:
Exception
Raises When the client isn’t authorized.
code: 401
-
exception
malix.utils.exceptions.
ResourceNotFound
(*args)¶ Bases:
malix.utils.exceptions.Error
Raises when there is no account resource belongs the respective credentials.
code : 404
-
exception
malix.utils.exceptions.
UnprocessableEntity
(*args)¶ Bases:
malix.utils.exceptions.Error
Raises when no valid inputs are given.
code: 422
-
class
malix.utils.headers.
Header
(token: Optional[str] = None)¶ Bases:
object
Header class of MalixMail.
- Parameters
token – Token of the account.
- Type
str
- header
if
token
isNone
{ "Content-Type": "application/ld+json", "accept": "application/ld+json" }
if
token
is provided{ "Content-Type": "application/ld+json", "accept": "application/ld+json", "Authorization": "bearer"+token }
-
malix.utils.jwtoken.
get_token
(address: Optional[str] = None, password: Optional[str] = None)¶ Returns a
Token
object for the given credentials.- Parameters
address (str) – Address of the account.
password (str) – Passowrd of the account.
- Returns
Token
object- Raises
InvalidCredentials – Raises when given credentials are invalid.
Submodules¶
malix.client module¶
-
class
malix.client.
Client
(address: str, password: str)¶ Bases:
object
Client class for MalixMail.
- Parameters
address (str) – Address of the account.
password (str) – Passowrd of the account.
- Returns Client
Client
object.
-
delete_account
(Id: str)¶ Deletes the account resource of the given account id.
- Parameters
Id (str) – Id of the account.
- Returns
204 (int) - Successfully deleted.
- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no account resource associated with the given account id.
AccessDenied – When the client doesn’t have the rights to perform some specific operations.When you don’t have the rights to perform the specific operations.
-
delete_message
(Id: str)¶ Deletes the message resource of the given message id.
- Parameters
Id (str) – Id of the message.
- Returns
204 (int) - Successfully deleted.
- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no message resource associated with the given message id.
-
download_message
(Id: str)¶ Downloads the message.
- Parameters
Id (str) – Id of the message.
- Returns
200 (int) - Successfully downloaded.
- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no message resource associated with the given message id.
-
get_account
(Id: str)¶ Returns an
Account
object for the given account id.- Parameters
Id (str) – Id of the account.
- Returns
Account
object.- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no account resource associated with the given account id.
-
get_message
(Id: str)¶ Returns a
Message
object for the given message id.- Parameters
Id (str) – Id of the account.
- Returns
Message
object.- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no message resource associated with the given message id.
-
get_message_collection
()¶ Returns collections of messages.
- Returns
dict - dictonary of inbox messages.
- Raises
NotAuthorized – When the client isn’t authorized.
-
get_my_account
()¶ Returns an
Account
object for the client.- Returns
Account
object.- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no account resource associated with the client’s address.
AccessDenied – When the client doesn’t have the rights to perform some specific operations.
-
update_message
(Id: str)¶ Updates seen status of the given message id.
- Parameters
Id (str) – Id of the account.
- Returns
response (dict) - Response of the patch request.
- Raises
NotAuthorized – When the client isn’t authorized.
ResourceNotFound – When there is no account resource associated with the given account id.
InvalidInput – When no valid inputs are given.
UnprocessableEntity – When no valid inputs are given.
-
malix.client.
get_domain
(Id: str)¶ Returns
Domain
object of the given Id.- Parameters
Id (str) – Id of the domain.
- Returns
Domain
object.- Raises
ResourceNotFound – When there is no domain resource associated with the given domain id.
-
malix.client.
get_domain_collection
(domains_only: bool = False)¶ Returns collection of available domains.
- Parameters
domains_only (bool) – Set true if you want to get only the domains containing in a list.
- Returns
if
domains_only: bool = False
: dictionary of available domains with other responses.if
domains_only: bool = True
: list of available domains.
-
malix.client.
get_token
(address: str, password: str)¶ Returns a
Token
object for the given credentials.- Parameters
address (str) – Address of the account.
password (str) – Passowrd of the account.
- Returns
Token
object- Raises
InvalidCredentials – Raises when given credentials are invalid.
-
malix.client.
make_account
(address: str, password: str)¶ Creates an account resourse using the given credentials.
- Parameters
address (str) – Address of the account.
password (str) – Passowrd of the account.
- Returns
Account
object.- Raises
InvalidInput – When no valid inputs are given.
UnprocessableEntity – When no valid inputs are given.
contact me¶
mail - sunilswain5555@pm.me
Join discord - rintu#6624