Lines Matching refs:email
1 :mod:`email.parser`: Parsing email messages
4 .. module:: email.parser
5 :synopsis: Parse flat text email messages to produce a message object structure.
7 **Source code:** :source:`Lib/email/parser.py`
12 created from whole cloth by creating an :class:`~email.message.EmailMessage`
14 using :meth:`~email.message.EmailMessage.set_content` and related methods, or
15 they can be created by parsing a serialized representation of the email
18 The :mod:`email` package provides a standard parser that understands most email
21 :class:`~email.message.EmailMessage` instance of the object structure. For
24 will return ``True`` from its :meth:`~email.message.EmailMessage.is_multipart`
26 such as :meth:`~email.message.EmailMessage.get_body`,
27 :meth:`~email.message.EmailMessage.iter_parts`, and
28 :meth:`~email.message.EmailMessage.walk`.
35 waiting for more input (such as reading an email message from a socket). The
41 connects the :mod:`email` package's bundled parser and the
42 :class:`~email.message.EmailMessage` class is embodied in the :mod:`policy`
51 The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` module,
52 provides an API that is conducive to incremental parsing of email messages,
53 such as would be necessary when reading the text of an email message from a
55 course be used to parse an email message fully contained in a :term:`bytes-like
66 :attr:`~email.message.EmailMessage.defects` attribute with a list of any
67 problems it found in a message. See the :mod:`email.errors` module for the
77 :attr:`~email.policy.Policy.message_factory` from the *policy*. Call
82 :class:`compat32 <email.policy.Compat32>` policy, which maintains backward
83 compatibility with the Python 3.2 version of the email package and provides
84 :class:`~email.message.Message` as the default factory. All other policies
85 provide :class:`~email.message.EmailMessage` as the default *_factory*. For
87 :mod:`~email.policy` documentation.
90 change to :data:`email.policy.default` in a future version of Python.
119 contain only ASCII text or, if :attr:`~email.policy.Policy.utf8` is
128 The :class:`BytesParser` class, imported from the :mod:`email.parser` module,
131 :mod:`email.parser` module also provides :class:`Parser` for parsing strings,
146 change to :data:`email.policy.default` in a future version of Python.
162 (or, if :attr:`~email.policy.Policy.utf8` is ``True``, :rfc:`6532`)
232 in the top-level :mod:`email` package namespace.
234 .. currentmodule:: email
241 *policy* are interpreted as with the :class:`~email.parser.BytesParser` class
254 *policy* are interpreted as with the :class:`~email.parser.BytesParser` class
266 with the :class:`~email.parser.Parser` class constructor.
276 interpreted as with the :class:`~email.parser.Parser` class constructor.
286 >>> import email
287 >>> msg = email.message_from_bytes(myBytes) # doctest: +SKIP
297 :meth:`~email.message.EmailMessage.is_multipart`, and
298 :meth:`~email.message.EmailMessage.iter_parts` will yield an empty list.
303 :meth:`~email.message.EmailMessage.is_multipart`, and
304 :meth:`~email.message.EmailMessage.iter_parts` will yield a list of subparts.
309 :meth:`~email.message.EmailMessage.is_multipart` method will return ``True``.
310 The single element yielded by :meth:`~email.message.EmailMessage.iter_parts`
316 :meth:`~email.message.EmailMessage.is_multipart` method may return ``False``.
317 If such messages were parsed with the :class:`~email.parser.FeedParser`,
319 :class:`~email.errors.MultipartInvariantViolationDefect` class in their
320 *defects* attribute list. See :mod:`email.errors` for details.