{"categories":[{"label":"Linguistic","url":"https://skillfed.io/packages/category/text-processing-linguistic"}],"enrichment":{"capability":"Detects the language of text using Google's CLD2 library, supporting over 165 languages and returning reliability scores and byte-range vectors.","skillfed_tags":["language-detection","multilingual","text-processing"],"use_cases":["Automatically categorize user-generated content by language in multilingual web applications or content management systems.","Pre-process text corpora for natural language processing pipelines by filtering or routing documents to language-specific models.","Detect language in HTTP requests or HTML documents, using optional hints from domain or HTTP headers to improve accuracy.","Identify the primary language in mixed-language documents and extract byte ranges showing where each language appears.","Triage support tickets or chat messages by language to route them to appropriate language-specific teams or handlers."],"what_it_does":"pycld2 is a Python wrapper around Google's Compact Language Detect 2 (CLD2), a C++ library that identifies the language of text. It consolidates the upstream CLD2 library with its bindings into a single pip-installable package, supporting detection across over 165 languages by default. The package exposes a single primary function, `detect()`, which takes UTF-8 text (as str or bytes) and returns a reliability flag, byte count, and a list of detected languages with confidence scores. Optionally, it can return byte-range vectors showing which language was detected in which part of the input, and accepts hints (top-level domain, language preference, encoding) to influence detection.\n\nThe package is built on precompiled wheels for Python 3.8\u20133.12 across macOS, Linux, and Windows, eliminating the need to compile C++ locally in most cases. It has no runtime dependencies beyond the C++ bindings. The API is minimal and straightforward: call `detect()` with your text and optional parameters, and receive structured results. It is useful for applications that need fast, lightweight language identification without the overhead of neural models, though the aging maintenance status (last release 504 days ago) means it may not have been tested against the very latest Python patch releases.","worth_installing":"Yes, if you need lightweight, fast language detection across many languages without external dependencies or neural models. The prebuilt wheels make installation straightforward on common platforms. However, consider the aging maintenance status (last release 504 days ago): verify that it works reliably with your target Python version and that CLD2's detection quality meets your accuracy requirements. If you need state-of-the-art accuracy, CLD3 or neural alternatives may be better; if you need speed and simplicity, pycld2 is a solid choice."},"id":"pycld2","links":{"html":"https://skillfed.io/packages/pycld2","md":"https://skillfed.io/packages/pycld2.md","pypi":"https://pypi.org/project/pycld2/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2025-03-28","license_spdx":null,"license_treatment":"permissive","name":"pycld2","python_support":"unspecified","summary":"Python bindings around Google Chromium's embedded compact language detection library (CLD2)"},"popularity":{"monthly_downloads":774217,"position":5096,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.42"}
