skillfed

cld3-py

Compact Language Detector v3 (CLD3) Python bindings — modernised fork with prebuilt wheels for Python 3.10–3.14.

cld3-py v3.1.0 93.6K downloads/30d#13,376 on PyPI1
Permissive 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) Active released

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-py

uv

uv add cld3-py

poetry

poetry add cld3-py

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: C++Programming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Text Processing :: Linguistic

Tags

language detectionlanguage identificationdetect text languagenlp language classifiercld3 python bindingsmultilingual text detectionlanguage recognition
language-detectionneural-networknlp

More Artificial Intelligence packages