langdetect
Language detection library ported from Google's language-detection.
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Language detection is non-deterministic; for consistent results, set DetectorFactory.seed = 0 before first detection.
- 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 · maintenance · safety
MIT (permissive) — Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions.
last release 2021-05-07 (1925 days) · last repo commit 2025-03-03 · 1,900 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 11,081,342 downloads/mo, #1,417 on PyPI
Alternatives
Verify before relying
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.")- 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.
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 on this page. Verify before relying on it.
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
langdetect on PyPI
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.
Language detection is non-deterministic; for consistent results, set DetectorFactory.seed = 0 before first detection.
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.")
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 | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagesix |
| Maintenance | Aging 1,925 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,081,342 / month, #1,417 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8 |
Evidence: langdetect-1.0.9-py2-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “language code from text”
- langdetectDetects the language of text input, supporting 55 languages and…
- gcld3Identifies the language of input text using a neural network model,…
- cld3-pyIdentifies the language of text using a neural network model,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Linguistic packages
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
tiktoken is a fast BPE tokenizer that converts text into token sequences compatible with OpenAI models, supporting multiple encoding schemes including o200k_base and model-specific encodings.
Install it if you work with OpenAI APIs or need to understand token boundaries in GPT-family models.
Detects character encoding and language in byte sequences with high accuracy, supporting 99 encodings and returning confidence scores, language tags, and MIME types.
Install it if you need to detect character encoding or language in byte data; the rewrite makes it substantially faster and more accurate than its predecessors.
Converts Unicode text to ASCII by transliterating non-ASCII characters into their closest ASCII equivalents, with no runtime dependencies.
However, if transliteration quality or ongoing maintenance matters, consider unidecode instead despite its GPL-only license.
Lark is a parsing library that builds abstract syntax trees from context-free grammars, supporting multiple parsing algorithms (Earley, LALR(1), CYK) with automatic line and column tracking.
Python bindings to the tree-sitter parsing library, enabling incremental parsing and syntax tree analysis for source code.
See also fasttext-langdetect · lingua-language-detector · spacy-language-detection · py3langid · langid · silpa_common · gcld3 · fast-langdetect · stopwordsiso · cld3-py