On this page
codecs.CodecInfo
Prev: codecs.Codec | Up: codecs | Next: codecs.decode
Rel: codecs.backslashreplace_errors, codecs.Codec, codecs.decode, codecs.encode
Ref: docs.python.org โ codecs.CodecInfo
Tags: #public #python3 #stdlib #codecs
Import
import codecs
from codecs import CodecInfo
Signature & Overview
codecs.CodecInfo(encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None, *, _is_text_encoding=None)
Codec details when looking up the codec registry
Methods & Attributes
CodecInfo.count(self, value, /)โ Return number of occurrences of value.CodecInfo.index(self, value, start=0, stop=9223372036854775807, /)โ Return first index of value.
Usage
import codecs
info = codecs.lookup("utf-8")
assert isinstance(info, codecs.CodecInfo) and info.name == "utf-8"
Gotchas
- Returned by
codecs.lookup(): Bundles stateless, incremental, and stream encoder/decoder callables.
REPL Inspect
from codecs import CodecInfo
help(CodecInfo)
Linked from
- tuts/python3/stdlib_module/codecs
- tuts/python3/stdlib_module/codecs/backslashreplace_errors
- tuts/python3/stdlib_module/codecs/Codec
- tuts/python3/stdlib_module/codecs/decode
- tuts/python3/stdlib_module/codecs/encode
- tuts/python3/stdlib_module/codecs/EncodedFile
- tuts/python3/stdlib_module/codecs/getdecoder
- tuts/python3/stdlib_module/codecs/getencoder
- tuts/python3/stdlib_module/codecs/getincrementaldecoder
- tuts/python3/stdlib_module/codecs/getincrementalencoder
- tuts/python3/stdlib_module/codecs/getreader
- tuts/python3/stdlib_module/codecs/getwriter
- tuts/python3/stdlib_module/codecs/ignore_errors
- tuts/python3/stdlib_module/codecs/IncrementalDecoder
- tuts/python3/stdlib_module/codecs/IncrementalEncoder
- tuts/python3/stdlib_module/codecs/iterdecode
- tuts/python3/stdlib_module/codecs/iterencode
- tuts/python3/stdlib_module/codecs/lookup
- tuts/python3/stdlib_module/codecs/lookup_error
- tuts/python3/stdlib_module/codecs/namereplace_errors
- tuts/python3/stdlib_module/codecs/open
- tuts/python3/stdlib_module/codecs/register
- tuts/python3/stdlib_module/codecs/register_error
- tuts/python3/stdlib_module/codecs/replace_errors
- tuts/python3/stdlib_module/codecs/StreamReader
- tuts/python3/stdlib_module/codecs/StreamReaderWriter
- tuts/python3/stdlib_module/codecs/StreamRecoder
- tuts/python3/stdlib_module/codecs/StreamWriter
- tuts/python3/stdlib_module/codecs/strict_errors
- tuts/python3/stdlib_module/codecs/xmlcharrefreplace_errors
Related notes
- tuts/python3/stdlib_module/codecs/backslashreplace_errors Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/Codec Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/decode Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/encode Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/codecs/EncodedFile links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/getdecoder links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/getencoder links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/getincrementaldecoder links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/getincrementalencoder links to this page; shared tags: #codecs, #stdlib