7. Binary Data Services
The modules described in this chapter provide some basic services operations for manipulation of binary data. Other operations on binary data, specifically in relation to file formats and network protocols, are described in the relevant sections.
Some libraries described under Text Processing Services also work with either
ASCII-compatible binary formats (for example, re) or all binary data
(for example, difflib).
In addition, see the documentation for Python’s built-in binary data types in Binary Sequence Types — bytes, bytearray, memoryview.
- 7.1.
struct— Interpret bytes as packed binary data - 7.2.
codecs— Codec registry and base classesencode()decode()lookup()CodecInfogetencoder()getdecoder()getincrementalencoder()getincrementaldecoder()getreader()getwriter()register()open()EncodedFile()iterencode()iterdecode()BOMBOM_BEBOM_LEBOM_UTF8BOM_UTF16BOM_UTF16_BEBOM_UTF16_LEBOM_UTF32BOM_UTF32_BEBOM_UTF32_LE- 7.2.1. Codec Base Classes
- 7.2.1.1. Error Handlers
- 7.2.1.2. Stateless Encoding and Decoding
- 7.2.1.3. Incremental Encoding and Decoding
- 7.2.1.4. Stream Encoding and Decoding
- 7.2.2. Encodings and Unicode
- 7.2.3. Standard Encodings
- 7.2.4. Python Specific Encodings
- 7.2.5.
encodings.idna— Internationalized Domain Names in Applications - 7.2.6.
encodings.mbcs— Windows ANSI codepage - 7.2.7.
encodings.utf_8_sig— UTF-8 codec with BOM signature
