codecs — Codec registry and base classes — Python 3.14.7 documentation

docs.python.org

Tin mới

struct — Interpret bytes as packed binary data

Python Module Index

3.14.7 Documentation

The Python Standard Library

Binary Data Services

Codec Base Classes¶

The module defines the following functions for encoding and decoding with any codec:

Codec Base Classes¶

The module defines the following functions for encoding and decoding with any codec:

UnicodeEncodeError

Encodes obj using the codec registered for encoding.

Codec Base Classes¶

The module defines the following functions for encoding and decoding with any codec:

io: Core tools for working with streams.

The module defines the following functions for encoding and decoding with any codec:

buffer-compatible object

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.

base64.encodebytes()

binascii.b2a_hex()

pickle: Convert Python objects to streams of bytes and back.

The following functions provide encoding and decoding functionality similar to codecs, but are not available as named codecs through codecs.encode() or codecs.decode(). They are used internally (for example, by pickle) a

stringprep: String preparation, as per RFC 3453

This module implements RFC 3490 (Internationalized Domain Names in Applications) and RFC 3492 (Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)). It builds upon the punycode encoding and stringprep

socket: Low-level networking interface.

This module implements RFC 3490 (Internationalized Domain Names in Applications) and RFC 3492 (Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)). It builds upon the punycode encoding and stringprep

http.client: HTTP and HTTPS protocol client (requires sockets).

This module implements RFC 3490 (Internationalized Domain Names in Applications) and RFC 3492 (Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)). It builds upon the punycode encoding and stringprep

ftplib: FTP protocol client (requires sockets).

This module implements RFC 3490 (Internationalized Domain Names in Applications) and RFC 3492 (Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)). It builds upon the punycode encoding and stringprep