skillfed

pycld3

CLD3 Python bindings

pycld3 v0.22 90.0K downloads/30d#13,620 on PyPI154
Permissive license Apache 2.0 Abandoned released

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 pycld3

uv

uv add pycld3

poetry

poetry add pycld3

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: C++Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Text Processing :: Linguistic

Tags

language detectionidentify text languagelanguage identificationmultilingual text detectionlanguage classifierdetect language from textbcp-47 language codesnlp language detection
language-detectionarchived

More Linguistic packages