incrementaldecoder([errors]returns an incrementaldecoder instance that can be used to decode byte strings in multiple steps errors is 'strictby default an instance of incrementaldecoder has these methodsmethod description decode(bytes [,final]returns decoded string from the encoded bytes in bytes final is flag that should be set to true on the final call to decode(resets the internal buffers and state reset( / -related functions the codecs module provides collection of high-level functions that are used to simplify / involving encoded text most programmers will use one of these functions instead of the low-level codecs interface described in the first section open(filenamemode[encoding[errors[buffering]]]opens filename in the given mode and provides transparent data encoding/decoding according to the encoding specified in encoding errors is one of 'strict''ignore''replace''backslashreplace'or 'xmlcharrefreplacethe default is 'strictbuffering has the same meaning as for the built-in open(function regardless of the mode specified in modethe underlying file is always opened in binary mode in python you can use the built-in open(function instead of codecs open(encodedfile(fileinputenc[outputenc [errors]] class that provides an encoding wrapper around an existing file objectfile data written to the file is first interpreted according to the input encoding inputenc and then written to the file using the output encoding outputenc data read from the file is decoded according to inputenc if outputenc is omittedit defaults to inputenc errors has the same meaning as for open(and defaults to 'strictiterencode(iterableencoding [errors] generator function that incrementally encodes all of the strings in iterable to the specified encoding errors is 'strictby default iterdecode(iterableencoding [errors] generator function that incrementally decodes all of the byte strings in iterable according to the specified encoding errors is 'strictby default useful constants codecs defines the following byte-order marker constants that can be used to help interpret files when you don' know anything about the underlying encoding these lib fl ff