#8888th of 93 in Data and scraping for AI
lingua-py
Offline language detector for Python, accurate on short text and single words
- Stars
- 1.8k
- License
- Apache-2.0
- Last commit
- Mar 2026
- Last release
- Mar 2026
- Language
- Python
1,694 on 26 Apr 20261,823 on 22 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
Python bindings to a Rust implementation that identifies which of 75 languages a text is written in. It combines a rule-based alphabet filter with a Naive Bayes model over character n-grams of size 1 to 5, with no neural networks and no external API. It returns a single language, a confidence value per language, or None below a set minimum relative distance.
Who it is for: Python developers adding language detection to NLP pipelines or text routing
Strengths
- Uses n-grams of size 1 to 5, aimed at short phrases and single words
- Models are stored as FSTs, so runtime memory is a few dozen megabytes
- Fully offline once installed; thread-safe, with models shared across detector instances
- Can restrict candidate languages and set a minimum relative distance to reject ambiguous input
Weaknesses
- Supports only 75 languages, by design favoring quality over quantity
- Requires Python 3.12 or newer for the 2.x line
- Compiled extension, so unsupported platforms need the pure-Python 1.x branch
- Single-word accuracy is lower; the German example scores 74.2% on words
What it needs
- no GPU
What changed
From the release notes. No flag means the note does not say so, not that the upgrade is safe.
Also in Data and scraping for AI
See all 93| Rank | Project | Score |
|---|---|---|
| #86 | video-analyzerCLI that describes videos using key frames, a vision LLM and Whisper | 22 out of 100 |
| #87 | blenderprocPython pipeline for rendering synthetic training images with Blender | 21 out of 100 |
| #89 | trOffline OCR SDK for scanned documents, C++ core with Python bindings | 20 out of 100 |
| #90 | deepseek_ocr_appWeb UI and API for running DeepSeek-OCR on images and PDFs | 19 out of 100 |
| #91 | libpostalC library for parsing and normalizing street addresses worldwide | 16 out of 100 |