pydoc > encodings

Help on package encodings:

📖 NAME

encodings — Standard "encodings" Package

🚀 Quick Reference

Use Case Command Description
Normalize an encoding name encodings.normalize_encoding('utf-8') Collapses non-alphanumeric characters to underscores according to normalization rules
Search for a codec by name encodings.search_function('utf-8') Returns the CodecInfo object for the given encoding
List all available encoding aliases encodings.aliases.getaliases() Returns a sequence of alias names (normalized)
Get codec info via standard library codecs.lookup('utf-8') Returns a CodecInfo object (uses the encodings package)

📚 MODULE REFERENCE

https://docs.python.org/3.10/library/encodings.html

The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.

📝 DESCRIPTION

Standard Python encoding modules are stored in this package directory.

Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module utf_8.py.

Each codec module must export the following interface:

In addition, a module may optionally also define the following APIs which are then used by the package's codec search function:

Written by Marc-Andre Lemburg (mal AT lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

📦 PACKAGE CONTENTS

🏗️ CLASSES

class CodecRegistryError

Builtins: builtins.LookupError, builtins.SystemError

Method resolution order:

  1. CodecRegistryError
  2. builtins.LookupError
  3. builtins.SystemError
  4. builtins.Exception
  5. builtins.BaseException
  6. builtins.object

Data descriptors defined here:

Methods inherited from builtins.LookupError:

Static methods inherited from builtins.LookupError:

Methods inherited from builtins.BaseException:

Data descriptors inherited from builtins.BaseException:

🔧 FUNCTIONS

normalize_encoding(encoding)

Normalize an encoding name.

Normalization works as follows: all non-alphanumeric characters except the dot used for Python package names are collapsed and replaced with a single underscore, e.g. ' -;#' becomes '_'. Leading and trailing underscores are removed.

Note that encoding names should be ASCII only.

search_function(encoding)

Search for a codec by name. Returns the CodecInfo object if found, otherwise raises LookupError.

📁 FILE

/usr/lib/python3.10/encodings/__init__.py

encodings
📖 NAME 🚀 Quick Reference 📚 MODULE REFERENCE 📝 DESCRIPTION 📦 PACKAGE CONTENTS 🏗️ CLASSES
class CodecRegistryError
🔧 FUNCTIONS
normalize_encoding(encoding) search_function(encoding)
📁 FILE

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-01 17:05 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^