Staging: this is not the live site, pydocs.org.
codecs codecs -- Python Codec Registry, API and helpers.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY. © Python Software Foundation. PSF License Version 2 · Official docs ↗
Symbols in codecs b backslashreplace_errors Implements the 'backslashreplace' error handling, which replaces malformed data with a backslashed escape sequence. BOM These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. BOM_BE These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. BOM_LE These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. BOM_UTF16 These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. BOM_UTF16_BE These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. BOM_UTF16_LE These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. BOM_UTF32 These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. BOM_UTF32_BE These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. BOM_UTF32_LE These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. BOM_UTF8 These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. c charmap_build Return a mapping suitable for encoding with a custom single-byte encoding. Codec Defines the interface for stateless encoders/decoders. CodecInfo Codec details when looking up the codec registry d decode Decodes obj using the codec registered for encoding. e encode Encodes obj using the codec registered for encoding. EncodedFile Return a wrapped version of file which provides transparent encoding translation. g getdecoder Lookup up the codec for the given encoding and return its decoder function. getencoder Lookup up the codec for the given encoding and return its encoder function. getincrementaldecoder Lookup up the codec for the given encoding and return its IncrementalDecoder class or factory function. getincrementalencoder Lookup up the codec for the given encoding and return its IncrementalEncoder class or factory function. getreader Lookup up the codec for the given encoding and return its StreamReader class or factory function. getwriter Lookup up the codec for the given encoding and return its StreamWriter class or factory function. i ignore_errors Implements the 'ignore' error handling, which ignores malformed data and continues. l lookup Looks up a codec tuple in the Python codec registry and returns a CodecInfo object. lookup_error Return the error handler for the specified error handling name or raise a LookupError, if no handler exists under this name. n namereplace_errors Implements the 'namereplace' error handling, which replaces an unencodable character with a \N{...} escape sequence. o open Open an encoded file using the given mode and return a wrapped version providing transparent encoding/decoding. r readbuffer_encode Return a tuple containing the raw bytes of buffer, a buffer-compatible object or str (encoded to UTF-8 before processing), and their length in bytes. register Register a codec search function. register_error Register the specified error handler under the name errors. replace_errors Implements the 'replace' error handling, which replaces malformed data with a replacement marker. s StreamReaderWriter StreamReaderWriter instances allow wrapping streams which work in both read and write modes. StreamRecoder StreamRecoder instances translate data from one encoding to another. strict_errors Implements the 'strict' error handling, which raises a UnicodeError on coding errors. u unregister Unregister a codec search function and clear the registry's cache. x xmlcharrefreplace_errors Implements the 'xmlcharrefreplace' error handling, which replaces an unencodable character with the appropriate XML character reference.
Python docs © Python Software Foundation · Examples CC0 ·
Source on GitHub · Not affiliated with the PSF