skillfed

cchardet

cChardet is high speed universal character encoding detector.

cchardet v2.1.7 8.4M downloads/30d#1,623 on PyPI409
Copyleft license Mozilla Public License AGING released

What it is and what it does

cchardet is a high-speed character encoding detector that identifies the encoding of raw byte strings by analyzing statistical patterns. It wraps the C library uchardet and supports a wide range of international encodings including UTF-8, UTF-16, CJK variants (Big5, EUC-JP, Shift-JIS, GB18030, etc.), Cyrillic, Arabic, and many European single-byte encodings. The package provides a simple API: call detect() on a byte buffer to get back a dictionary with the detected encoding and language hint.

The main use case is preprocessing text data when the source encoding is unknown—common in web scraping, log parsing, and data import workflows. It has no runtime dependencies and installs via prebuilt wheels on most platforms. However, the project is aging: the last release was 2020-10-27, and while the repository remains active, there have been no new package versions for over four years. The copyleft license (Mozilla Public License) requires careful review if you plan to distribute derived works.

Use it for:

  • Detect encoding of downloaded web pages or API responses before parsing.
  • Identify encoding of legacy log files or CSV imports with unknown character sets.
  • Preprocess user-uploaded text files to normalize encoding before storage.
  • Batch-process mixed-encoding document collections to extract text reliably.
  • Auto-detect encoding in text processing pipelines to avoid manual charset specification.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

cchardet detects the character encoding of byte strings using a C binding to uchardet, supporting dozens of international encodings and languages with high speed.

Yes, if you need fast encoding detection and can accept the aging codebase. The package is stable with no known vulnerabilities, but the lack of updates since 2020-10-27 means it may not support newer Python versions or benefit from recent uchardet improvements. Use it for production workloads where encoding detection is a bottleneck and you are comfortable pinning to version 2.1.7; monitor the repository for future releases or evaluate alternatives if you require active maintenance.

Install

cchardet on PyPI

pip

pip install cchardet

uv

uv add cchardet

poetry

poetry add cchardet

Installing cchardet

Before you install

Medium install friction due to compiled C extensions; prebuilt wheels are available for Python 3.6–3.9 on Windows, Linux, and macOS x86_64/i686, but the package is aging—last release was 2020-10-27 and no updates in over four years despite an active repository.

License in practice

Licensed under Mozilla Public License (copyleft), with dual licensing also under GPL and LGPL per classifiers. Copyleft terms require derivative works to be distributed under compatible terms; review your project's license compatibility before use.

Quickstart

import cchardet

with open('file.txt', 'rb') as f:
    result = cchardet.detect(f.read())
    print(result)

Requires a C compiler and build tools at install time; prebuilt wheels are available for common platforms but not all architectures.

Verify before relying

  • Whether the package remains compatible with Python 3.10+ despite no official release since 2020.
  • Current performance relative to modern encoding detectors in production workloads.
  • Whether the underlying uchardet library has received security or accuracy updates since the last cchardet release.
  • Confidence score range and interpretation for detect() results.

Package facts

License Mozilla Public License (copyleft)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 2,117 days since the last release
Last repo commit
First released
Downloads 8,435,620/month — #1,623 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cchardet-2.1.7-cp36-cp36m-macosx_10_9_x86_64.whl; cchardet-2.1.7-cp36-cp36m-manylinux1_i686.whl; cchardet-2.1.7-cp36-cp36m-manylinux1_x86_64.whl; cchardet-2.1.7-cp36-cp36m-manylinux2010_i686.whl; cchardet-2.1.7-cp36-cp36m-manylinux2010_x86_64.whl; cchardet-2.1.7-cp36-cp36m-win32.whl; cchardet-2.1.7-cp36-cp36m-win_amd64.whl; cchardet-2.1.7-cp37-cp37m-macosx_10_9_x86_64.whl; cchardet-2.1.7-cp37-cp37m-manylinux1_i686.whl; cchardet-2.1.7-cp37-cp37m-manylinux1_x86_64.whl; cchardet-2.1.7-cp37-cp37m-manylinux2010_i686.whl; cchardet-2.1.7-cp37-cp37m-manylinux2010_x86_64.whl; cchardet-2.1.7-cp37-cp37m-win32.whl; cchardet-2.1.7-cp37-cp37m-win_amd64.whl; cchardet-2.1.7-cp38-cp38-macosx_10_9_x86_64.whl; cchardet-2.1.7-cp38-cp38-manylinux1_i686.whl; cchardet-2.1.7-cp38-cp38-manylinux1_x86_64.whl; cchardet-2.1.7-cp38-cp38-manylinux2010_i686.whl; cchardet-2.1.7-cp38-cp38-manylinux2010_x86_64.whl; cchardet-2.1.7-cp38-cp38-win32.whl

Keywords: cython, chardet, charsetdetect

License :: OSI Approved :: GNU General Public License (GPL)License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)License :: OSI Approved :: Mozilla Public License 1.1 (MPL 1.1)Programming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries

Tags

character encoding detectioncharset detectiondetect text encodingunicode encoding identifierfast encoding detectorlanguage encoding identifierbyte string encodinginternational charset support
encoding-detectioncharacter-encodingtext-preprocessing

More Libraries packages