pycld3
CLD3 Python bindings
What it is and what it does
pycld3 is a Python wrapper around Google's CLD3 C++ library for language detection. It exports two main functions: get_language() to detect the primary language of a text sample, and get_frequent_languages() to identify multiple languages within mixed-language text. Both return language predictions as BCP-47 codes with confidence scores and reliability flags.
The package supports over 100 languages and scripts, with some languages differentiated by script. It has no Python runtime dependencies but requires Protobuf headers and a C++ compiler for source builds. Wheels are provided for CPython 3.6–3.9 on macOS and manylinux1, eliminating the need for external dependencies on those platforms. However, the project is archived and has not been updated since 2021-03-09.
Use it for:
- Automatically categorize user-generated content by language for routing to language-specific pipelines or moderation teams.
- Preprocess multilingual datasets by detecting and filtering text by language before feeding to downstream models.
- Identify the language of short social media posts or comments to enable language-aware sentiment analysis.
- Build a language-aware search index by detecting the language of documents at indexing time.
- Detect language switches within a single text sample to handle code-mixed or multilingual user input.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects the language of text using Google's Compact Language Detector v3, returning language codes and confidence scores for over 100 languages and scripts.
No, not recommended for new projects. The package is archived and unmaintained since 2021-03-09, with no updates for modern Python versions. The description itself recommends an alternative official package as a better choice. Install friction is also medium on non-wheel platforms. Consider the recommended alternative instead unless you have a specific reason to stay on this package.
Install
pycld3 on PyPI
pip
pip install pycld3uv
uv add pycld3poetry
poetry add pycld3Installing pycld3
Before you install
Medium install friction: wheels are available for CPython 3.6–3.9 on macOS and manylinux1, but source installation requires the Protobuf compiler, development headers, and a C++ compiler. The package is archived and unmaintained since 2021.
License in practice
Licensed under Apache 2.0 (permissive), so you can use it freely in commercial and private projects with minimal restrictions.
Quickstart
pip install -U pycld3
import cld3
result = cld3.get_language("This is a test")
print(result.language, result.probability)
On non-wheel platforms (Alpine, i686, Windows), you must install Protobuf compiler (protoc), libprotobuf development headers, and a C++ compiler before pip install will succeed.
Verify before relying
- Whether the package works reliably with Python versions beyond 3.9, given the last release was 2021-03-09.
- Current compatibility with modern Protobuf versions, given the long maintenance gap since 2021.
- Whether an alternative official package would be a drop-in replacement or requires code changes.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,984 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 90,041/month — #13,620 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pycld3-0.22-cp36-cp36m-macosx_10_14_x86_64.whl; pycld3-0.22-cp36-cp36m-manylinux1_x86_64.whl; pycld3-0.22-cp37-cp37m-macosx_10_14_x86_64.whl; pycld3-0.22-cp37-cp37m-manylinux1_x86_64.whl; pycld3-0.22-cp38-cp38-macosx_10_14_x86_64.whl; pycld3-0.22-cp38-cp38-manylinux1_x86_64.whl; pycld3-0.22-cp39-cp39-macosx_10_14_x86_64.whl; pycld3-0.22-cp39-cp39-manylinux1_x86_64.whl
Keywords: cld3, cffi, language, langdetect, cld, nlp
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
cld3-pyIdentifies the language of text using a neural…
permissive · top 15,000 on PyPI
pycld2Detects the language of text using Google's…
permissive · top 15,000 on PyPI
gcld3Identifies the language of input text using a…
unclear · top 15,000 on PyPI
py3langidIdentifies the language of text in one of 97…
permissive · top 15,000 on PyPI
langidIdentifies the language of text input across 97…
permissive · top 15,000 on PyPI
lingua-language-detectorDetects which language a text is written in,…
permissive · top 5,000 on PyPI
langdetectDetects the language of text input, supporting…
permissive · top 5,000 on PyPI
google-re2A drop-in replacement for Python's re module…
permissive · top 5,000 on PyPI
pyclnPycln finds and removes unused import…
permissive · top 15,000 on PyPI
pybind11-globalA header-only C++ library that generates Python…
permissive · top 15,000 on PyPI