ensurepip.version()

ensurepip.version() Returns a string specifying the bundled version of pip that will be installed when bootstrapping an environment.

ensurepip.bootstrap()

ensurepip.bootstrap(root=None, upgrade=False, user=False, altinstall=False, default_pip=False, verbosity=0) Bootstraps pip into the current or designated environment. root specifies an alternative root directory to install relative to. If root is None, then installation uses the default install location for the current environment. upgrade indicates whether or not to upgrade an existing installation of an earlier version of pip to the bundled version. user indicates whether to use the user s

encodings.idna.ToUnicode()

encodings.idna.ToUnicode(label) Convert a label to Unicode, as specified in RFC 3490.

encodings.idna.ToASCII()

encodings.idna.ToASCII(label) Convert a label to ASCII, as specified in RFC 3490. UseSTD3ASCIIRules is assumed to be false.

encodings.idna.nameprep()

encodings.idna.nameprep(label) Return the nameprepped version of label. The implementation currently assumes query strings, so AllowUnassigned is true.

email: Examples

Here are a few examples of how to use the email package to read, write, and send simple email messages, as well as more complex MIME messages. First, let’s see how to create and send a simple text message: # Import smtplib for the actual sending function import smtplib # Import the email modules we'll need from email.mime.text import MIMEText # Open a plain text file for reading. For this example, assume that # the text file contains only ASCII characters. with open(textfile) as fp: # Cr

email.utils.unquote()

email.utils.unquote(str) Return a new string which is an unquoted version of str. If str ends and begins with double quotes, they are stripped off. Likewise if str ends and begins with angle brackets, they are stripped off.

email.utils.quote()

email.utils.quote(str) Return a new string with backslashes in str replaced by two backslashes, and double quotes replaced by backslash-double quote.

email.utils.parsedate_tz()

email.utils.parsedate_tz(date) Performs the same function as parsedate(), but returns either None or a 10-tuple; the first 9 elements make up a tuple that can be passed directly to time.mktime(), and the tenth is the offset of the date’s timezone from UTC (which is the official term for Greenwich Mean Time) [1]. If the input string has no timezone, the last element of the tuple returned is None. Note that indexes 6, 7, and 8 of the result tuple are not usable.

email.utils.parsedate_to_datetime()

email.utils.parsedate_to_datetime(date) The inverse of format_datetime(). Performs the same function as parsedate(), but on success returns a datetime. If the input date has a timezone of -0000, the datetime will be a naive datetime, and if the date is conforming to the RFCs it will represent a time in UTC but with no indication of the actual source timezone of the message the date comes from. If the input date has any other valid timezone offset, the datetime will be an aware datetime with