.. _f-emailmessage: module ``grabber.email_message`` ================================ .. inheritance-diagram:: pymmails.grabber.email_message Short summary +++++++++++++ module ``pymmails.grabber.email_message`` define an Email grabbed from a server. :githublink:`%|py|6` Classes +++++++ +---------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ | class | truncated documentation | +=====================================================================+=========================================================================================+ | :class:`EmailMessage ` | overloads the message to class to add some functionalities such as a display using HTML | +---------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ Properties ++++++++++ +---------------------------------------------------------------------------+--------------------------------+ | property | truncated documentation | +===========================================================================+================================+ | :meth:`body ` | return the body of the message | +---------------------------------------------------------------------------+--------------------------------+ | :meth:`body_html ` | return the body of the messag | +---------------------------------------------------------------------------+--------------------------------+ | :meth:`Fields ` | | +---------------------------------------------------------------------------+--------------------------------+ | :meth:`UniqueID ` | builds a unique ID | +---------------------------------------------------------------------------+--------------------------------+ Static Methods ++++++++++++++ +-------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | staticmethod | truncated documentation | +=============================================================================================================+=======================================================================================================================+ | :meth:`call_decode_header ` | call `email.header.decode_header `_ | +-------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :meth:`create_from_bytes ` | Creates an instance of :class:`EmailMessage` from a binary string (bytes) (see :meth:`as_bytes`). | +-------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :meth:`interpret_default_filename ` | reverse engineer method :meth:`default_filename` | +-------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :meth:`read_metadata ` | read metadata assuming metafile contaings a json string | +-------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +===================================================================================================+==============================================================================================================+ | :py:meth:`__lt__ ` | usual | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`__sortkey__ ` | usual | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`as_bytes ` | converts the mail into a binary string | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`as_string ` | Converts the mail into a string. | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`decode_header ` | decode a string encoded in the header | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`default_filename ` | define a default filename (no extension) | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`dump ` | Dumps a message using a call such as :class:`EmailMessageRenderer`. | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`dump_attachments ` | Dumps the mail into a folder using HTML format. If the destination files already exists, it skips it. If ... | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`enumerate_attachments ` | enumerate the attachments as 4-uple (filename, content, message_id, content_id) | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_all_charsets ` | returns all the charsets | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_date ` | return a datetime object for the field Date | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_date_str ` | return the date into a string | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_field ` | get a field and cleans it | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_from ` | returns a tuple (label, email address) or a list of groups from the regular expression | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_from_str ` | return a string for the receivers | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_name ` | return the sender name of an email (if available) | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_nb_attachements ` | return the number of attachments | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_to ` | return the receivers | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_to_str ` | return a string for the receivers | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`to_dict ` | Returns all fields for an emails as a dictionary | +---------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: pymmails.grabber.email_message :members: :special-members: __init__ :show-inheritance: