cld3-py
Compact Language Detector v3 (CLD3) Python bindings — modernised fork with prebuilt wheels for Python 3.10–3.14.
What it is and what it does
cld3-py is a Python wrapper around a neural network model for language identification. It takes text input and returns the detected language as a BCP-47 code (e.g., 'en' for English, 'bg-Latn' for Bulgarian in Latin script) along with a confidence probability, reliability flag, and proportion of the text in that language. The model works by extracting character n-grams from input, hashing them to embedding vectors, and passing the averaged embeddings through a neural network with a hidden layer and softmax output.
The package is a modernized fork with prebuilt wheels for recent Python versions and multiple platforms, eliminating the need to compile C++ code during installation on most systems. It supports Python 3.10 through 3.14 (including free-threaded builds) and runs on macOS, Linux, and Windows. The API is backward-compatible with the original gcld3 package, so existing code imports work unchanged.
Use it for:
- Automatically classify user-generated content by language for routing to appropriate moderation or translation pipelines
- Detect language in multilingual documents to split and process sections separately
- Filter or prioritize search results by language without relying on HTTP headers or user metadata
- Identify the primary language of web pages or social media posts for content aggregation
- Validate language metadata in datasets or correct misclassified language tags
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Identifies the language of text using a neural network model, returning language codes with confidence scores and reliability indicators.
Yes, if you need reliable language detection without external API calls or heavy dependencies. The prebuilt wheels make installation straightforward on common platforms, the Apache License is permissive, and active maintenance ensures compatibility with current Python versions. Medium install friction is acceptable for a compiled model. Verify accuracy on your specific text types before production use.
Install
cld3-py on PyPI
pip
pip install cld3-pyuv
uv add cld3-pypoetry
poetry add cld3-pyInstalling cld3-py
Before you install
Medium install friction due to compiled C++ bindings, but prebuilt wheels are available for Python 3.10, 3.11, 3.12, 3.13, 3.14 across macOS (Intel and ARM), Linux (manylinux and musllinux), and Windows. Active maintenance with recent releases.
License in practice
Apache License permissive license allows commercial and private use with minimal restrictions; attribution required but no copyleft obligations.
Quickstart
pip install cld3-py
import gcld3
detector = gcld3.NNetLanguageIdentifier(min_num_bytes=0, max_num_bytes=1000)
result = detector.FindLanguage(text="This text is written in English.")
print(result.language, result.probability, result.is_reliable)
Verify before relying
- Actual accuracy and reliability metrics on real-world multilingual corpora
- Performance characteristics (latency, memory footprint) for typical use cases
- Whether the package handles mixed-script or code-switched text reliably
- Total number of supported languages and script variants
Package facts
| License | Copyright 2016 Google Inc. All rights reserved. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions.… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 113 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 93,597/month — #13,376 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cld3_py-3.1.0-cp310-cp310-macosx_10_15_x86_64.whl; cld3_py-3.1.0-cp310-cp310-macosx_11_0_arm64.whl; cld3_py-3.1.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; cld3_py-3.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; cld3_py-3.1.0-cp310-cp310-musllinux_1_2_aarch64.whl; cld3_py-3.1.0-cp310-cp310-musllinux_1_2_x86_64.whl; cld3_py-3.1.0-cp310-cp310-win_amd64.whl; cld3_py-3.1.0-cp311-cp311-macosx_10_15_x86_64.whl; cld3_py-3.1.0-cp311-cp311-macosx_11_0_arm64.whl; cld3_py-3.1.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; cld3_py-3.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; cld3_py-3.1.0-cp311-cp311-musllinux_1_2_aarch64.whl; cld3_py-3.1.0-cp311-cp311-musllinux_1_2_x86_64.whl; cld3_py-3.1.0-cp311-cp311-win_amd64.whl; cld3_py-3.1.0-cp312-cp312-macosx_10_15_x86_64.whl; cld3_py-3.1.0-cp312-cp312-macosx_11_0_arm64.whl; cld3_py-3.1.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; cld3_py-3.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; cld3_py-3.1.0-cp312-cp312-musllinux_1_2_aarch64.whl; cld3_py-3.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
Keywords: language-detection, nlp, cld3, language-identification
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
gcld3Identifies the language of input text using a…
unclear · top 15,000 on PyPI
pycld3Detects the language of text using Google's…
permissive · top 15,000 on PyPI
pycld2Detects the language of text using Google's…
permissive · top 15,000 on PyPI
lingua-language-detectorDetects which language a text is written in,…
permissive · top 5,000 on PyPI
dlib-bindlib-bin provides pre-compiled binary wheels of…
unclear · top 5,000 on PyPI
langdetectDetects the language of text input, supporting…
permissive · top 5,000 on PyPI
openbabel-wheelProvides prebuilt Python wheels for OpenBabel,…
copyleft · top 15,000 on PyPI
minisbdDetects sentence boundaries in text across many…
agpl · top 15,000 on PyPI
cchardetcchardet detects the character encoding of byte…
copyleft · top 5,000 on PyPI
fasttext-langdetectIdentifies the language of UTF-8 text using…
permissive · top 15,000 on PyPI