💾 Archived View for tris.fyi › pydoc › quopri captured on 2022-01-08 at 13:42:10. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Back to module index

Go to module by name

quopri

Conversions to/from quoted-printable transport encoding as per RFC 1521.

Functions

a2b_qp

a2b_qp(data, header=False)

  Decode a string of qp-encoded data.

b2a_qp

b2a_qp(data, quotetabs=False, istext=True, header=False)

  Encode a string using quoted-printable encoding.

  On encoding, when istext is set, newlines are not encoded, and white
  space at end of lines is.  When istext is not set, \r and \n (CR/LF)
  are both encoded.  When quotetabs is set, space and tabs are encoded.

decode

decode(input, output, header=False)

  Read 'input', apply quoted-printable decoding, and write to 'output'.
      'input' and 'output' are binary file objects.
      If 'header' is true, decode underscore as space (per RFC 1522).

decodestring

decodestring(s, header=False)

encode

encode(input, output, quotetabs, header=False)

  Read 'input', apply quoted-printable encoding, and write to 'output'.

      'input' and 'output' are binary file objects. The 'quotetabs' flag
      indicates whether embedded tabs and spaces should be quoted. Note that
      line-ending tabs and spaces are always encoded, as per RFC 1521.
      The 'header' flag indicates whether we are encoding spaces as _ as per RFC
      1522.

encodestring

encodestring(s, quotetabs=False, header=False)

ishex

ishex(c)

  Return true if the byte ordinal 'c' is a hexadecimal digit in ASCII.

main

main()

needsquoting

needsquoting(c, quotetabs, header)

  Decide whether a particular byte ordinal needs to be quoted.

      The 'quotetabs' flag indicates whether embedded tabs and spaces should be
      quoted.  Note that line-ending tabs and spaces are always encoded, as per
      RFC 1521.
    

quote

quote(c)

  Quote a single character.

unhex

unhex(s)

  Get the integer value of a hexadecimal number.

Other members

EMPTYSTRING = b''
ESCAPE = b'='
HEX = b'0123456789ABCDEF'
MAXLINESIZE = 76