--- id: langdetect version: "1.0.9" license: MIT license_treatment: permissive maintenance: aging --- # langdetect — Language detection library ported from Google's language-detection. License: permissive · Maintenance: aging · Downloads: 11.1M/mo ## What it is and what it does langdetect is a Python port of Google's language-detection library, ported from Java. It identifies the language of input text and returns either a single language code (ISO 639-1 format) or a ranked list of candidate languages with confidence scores. The library supports 55 languages out of the box, including common European, Asian, and other language families. The package depends only on six for Python 2/3 compatibility. Its core limitation is that the detection algorithm is non-deterministic—short or ambiguous text may produce different results across runs unless you seed the detector factory. It's designed for straightforward language identification tasks where you need quick results without external API calls or heavy dependencies. Use it for: - Automatically categorize user-generated content by language for multilingual applications or content moderation systems. - Route text to language-specific processing pipelines (spell-checkers, NLP models, translation services) based on detected language. - Identify the language of incoming support tickets or messages to assign them to appropriate language teams. - Filter or segment documents in mixed-language datasets during data preprocessing for machine learning. - Build language-aware search or recommendation features that adapt results based on detected user input language. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Detects the language of text input, supporting 55 languages and returning either a language code or probability scores for candidate languages. Yes, if you need lightweight, dependency-minimal language detection without external API calls. The library is stable and permissively licensed, but consider it aging—last release was 2021. It's suitable for production use in applications where non-determinism on ambiguous text is acceptable and you don't require state-of-the-art accuracy. For modern alternatives or higher accuracy, evaluate current options. ## Install pip install langdetect uv add langdetect poetry add langdetect ## Installing langdetect Before you install: Low install friction with a single lightweight dependency (six). Maintenance is aging—last release was in 2021 and the last commit was 2025-03-03, but the repository remains active and unarchived with stable production status. License in practice: Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions. Quickstart: pip install langdetect from langdetect import detect, detect_langs detect("War doesn't show who's right, just who's left.") detect_langs("Otec matka syn.") Language detection is non-deterministic; for consistent results, set DetectorFactory.seed = 0 before first detection. Verify before relying: - Current accuracy and performance characteristics compared to modern language detection libraries. - Whether the library is actively maintained or in maintenance-only mode given the 2021 latest release date. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 11.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags language detection, detect text language, language identification, multilingual text classifier, language code from text, language probability detection, identify document language, language-identification, nlp-preprocessing [View on SkillFed](https://skillfed.io/packages/langdetect) · [View on PyPI](https://pypi.org/project/langdetect/)