#8888th of 93 in Data and scraping for AI

lingua-py

Offline language detector for Python, accurate on short text and single words

Releases and problems feed (RSS)

Stars
1.8k
License
Apache-2.0
Last commit
Mar 2026
Last release
Mar 2026
Language
Python
Stars, last 30 weeks+129
26 Apr 2026: 1,694 stars3 May 2026: 1,700 stars10 May 2026: 1,706 stars17 May 2026: 1,710 stars24 May 2026: 1,715 stars31 May 2026: 1,718 stars7 Jun 2026: 1,722 stars14 Jun 2026: 1,724 stars21 Jun 2026: 1,733 stars28 Jun 2026: 1,738 stars5 Jul 2026: 1,743 stars12 Jul 2026: 1,751 stars19 Jul 2026: 1,752 stars26 Jul 2026: 1,757 stars2 Aug 2026: 1,763 stars9 Aug 2026: 1,765 stars16 Aug 2026: 1,771 stars23 Aug 2026: 1,773 stars30 Aug 2026: 1,780 stars6 Sept 2026: 1,782 stars13 Sept 2026: 1,786 stars20 Sept 2026: 1,792 stars27 Sept 2026: 1,799 stars4 Oct 2026: 1,800 stars11 Oct 2026: 1,802 stars18 Oct 2026: 1,807 stars25 Oct 2026: 1,809 stars1 Nov 2026: 1,813 stars8 Nov 2026: 1,816 stars15 Nov 2026: 1,820 stars22 Nov 2026: 1,823 stars

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
Also in Data and scraping for AI
RankProjectScore
#86video-analyzerCLI that describes videos using key frames, a vision LLM and Whisper1.6k starsApache-2.022 out of 100
#87blenderprocPython pipeline for rendering synthetic training images with Blender3.8k starsGPL-3.021 out of 100
#89trOffline OCR SDK for scanned documents, C++ core with Python bindings1.4k starsno license20 out of 100
#90deepseek_ocr_appWeb UI and API for running DeepSeek-OCR on images and PDFs1.9k starsMIT19 out of 100
#91libpostalC library for parsing and normalizing street addresses worldwide4.9k starsMIT16 out of 100