Internet Data Handling¶
This chapter describes modules which support handling data formats commonly used on the internet.
email
— An email and MIME handling packageemail.message
: Representing an email messageEmailMessage
EmailMessage.as_string()
EmailMessage.__str__()
EmailMessage.as_bytes()
EmailMessage.__bytes__()
EmailMessage.is_multipart()
EmailMessage.set_unixfrom()
EmailMessage.get_unixfrom()
EmailMessage.__len__()
EmailMessage.__contains__()
EmailMessage.__getitem__()
EmailMessage.__setitem__()
EmailMessage.__delitem__()
EmailMessage.keys()
EmailMessage.values()
EmailMessage.items()
EmailMessage.get()
EmailMessage.get_all()
EmailMessage.add_header()
EmailMessage.replace_header()
EmailMessage.get_content_type()
EmailMessage.get_content_maintype()
EmailMessage.get_content_subtype()
EmailMessage.get_default_type()
EmailMessage.set_default_type()
EmailMessage.set_param()
EmailMessage.del_param()
EmailMessage.get_filename()
EmailMessage.get_boundary()
EmailMessage.set_boundary()
EmailMessage.get_content_charset()
EmailMessage.get_charsets()
EmailMessage.is_attachment()
EmailMessage.get_content_disposition()
EmailMessage.walk()
EmailMessage.get_body()
EmailMessage.iter_attachments()
EmailMessage.iter_parts()
EmailMessage.get_content()
EmailMessage.set_content()
EmailMessage.make_related()
EmailMessage.make_alternative()
EmailMessage.make_mixed()
EmailMessage.add_related()
EmailMessage.add_alternative()
EmailMessage.add_attachment()
EmailMessage.clear()
EmailMessage.clear_content()
EmailMessage.preamble
EmailMessage.epilogue
EmailMessage.defects
MIMEPart
email.parser
: Parsing email messagesemail.generator
: Generating MIME documentsemail.policy
: Policy ObjectsPolicy
Policy.max_line_length
Policy.linesep
Policy.cte_type
Policy.raise_on_defect
Policy.mangle_from_
Policy.message_factory
Policy.clone()
Policy.handle_defect()
Policy.register_defect()
Policy.header_max_count()
Policy.header_source_parse()
Policy.header_store_parse()
Policy.header_fetch_parse()
Policy.fold()
Policy.fold_binary()
EmailPolicy
default
SMTP
SMTPUTF8
HTTP
strict
Compat32
compat32
email.errors
: Exception and Defect classesemail.headerregistry
: Custom Header Objectsemail.contentmanager
: Managing MIME Contentemail
: Examplesemail.message.Message
: Representing an email message using thecompat32
APIMessage
Message.as_string()
Message.__str__()
Message.as_bytes()
Message.__bytes__()
Message.is_multipart()
Message.set_unixfrom()
Message.get_unixfrom()
Message.attach()
Message.get_payload()
Message.set_payload()
Message.set_charset()
Message.get_charset()
Message.__len__()
Message.__contains__()
Message.__getitem__()
Message.__setitem__()
Message.__delitem__()
Message.keys()
Message.values()
Message.items()
Message.get()
Message.get_all()
Message.add_header()
Message.replace_header()
Message.get_content_type()
Message.get_content_maintype()
Message.get_content_subtype()
Message.get_default_type()
Message.set_default_type()
Message.get_params()
Message.get_param()
Message.set_param()
Message.del_param()
Message.set_type()
Message.get_filename()
Message.get_boundary()
Message.set_boundary()
Message.get_content_charset()
Message.get_charsets()
Message.get_content_disposition()
Message.walk()
Message.preamble
Message.epilogue
Message.defects
email.mime
: Creating email and MIME objects from scratchemail.header
: Internationalized headersemail.charset
: Representing character setsCharset
Charset.input_charset
Charset.header_encoding
Charset.body_encoding
Charset.output_charset
Charset.input_codec
Charset.output_codec
Charset.get_body_encoding()
Charset.get_output_charset()
Charset.header_encode()
Charset.header_encode_lines()
Charset.body_encode()
Charset.__str__()
Charset.__eq__()
Charset.__ne__()
add_charset()
add_alias()
add_codec()
email.encoders
: Encodersemail.utils
: Miscellaneous utilitiesemail.iterators
: Iterators
json
— JSON encoder and decodermailbox
— Manipulate mailboxes in various formatsMailbox
objectsMailbox
Mailbox.add()
Mailbox.remove()
Mailbox.__delitem__()
Mailbox.discard()
Mailbox.__setitem__()
Mailbox.iterkeys()
Mailbox.keys()
Mailbox.itervalues()
Mailbox.__iter__()
Mailbox.values()
Mailbox.iteritems()
Mailbox.items()
Mailbox.get()
Mailbox.__getitem__()
Mailbox.get_message()
Mailbox.get_bytes()
Mailbox.get_string()
Mailbox.get_file()
Mailbox.__contains__()
Mailbox.__len__()
Mailbox.clear()
Mailbox.pop()
Mailbox.popitem()
Mailbox.update()
Mailbox.flush()
Mailbox.lock()
Mailbox.unlock()
Mailbox.close()
Maildir
mbox
MH
Babyl
MMDF
Message
objects- Exceptions
- Examples
mimetypes
— Map filenames to MIME typesbase64
— Base16, Base32, Base64, Base85 Data Encodingsb64encode()
b64decode()
standard_b64encode()
standard_b64decode()
urlsafe_b64encode()
urlsafe_b64decode()
b32encode()
b32decode()
b32hexencode()
b32hexdecode()
b16encode()
b16decode()
a85encode()
a85decode()
b85encode()
b85decode()
decode()
decodebytes()
encode()
encodebytes()
- Security Considerations
binascii
— Convert between binary and ASCIIquopri
— Encode and decode MIME quoted-printable data