skillfed

py3langid

Fork of the language identification tool langid.py, featuring a modernized codebase and faster execution times.

py3langid v0.3.0 437.9K downloads/30d#6,663 on PyPI63
Permissive license BSD DORMANT released

What it is and what it does

py3langid is a modernized fork of langid.py that detects which of 97 languages a piece of text is written in. It returns both the ISO 639-1 language code and a confidence score. The package is designed to be a drop-in replacement for the original, with significant performance improvements: imports are about 30% faster, model loading is 25-30x faster, and classification itself is 5-6x faster on paragraphs.

The tool works as both a Python library and a command-line utility. It uses a pre-trained statistical model built from diverse sources (JRC-Acquis, ClueWeb 09, Wikipedia, Reuters RCV2, Debian i18n) and requires only numpy as a dependency. It supports language subsetting, probability normalization, and can be deployed as a WSGI web service.

Use it for:

  • Automatically categorize user-generated content by language for multilingual applications or content management systems.
  • Filter or route text documents to language-specific processing pipelines in NLP workflows.
  • Identify the dominant language in mixed-language documents or social media posts for downstream analysis.
  • Build language detection into a command-line data pipeline using the standalone langid tool.
  • Normalize confidence scores to probabilities for machine learning feature engineering or confidence thresholding.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Identifies the language of text in one of 97 languages using a pre-trained statistical model, with optimized speed for Python 3.6+.

Yes, if you need fast language detection across 97 languages with minimal dependencies. The dormant maintenance status is not a blocker—the package is stable, has no known vulnerabilities, and the last commit is recent enough. Install if you want a lightweight, performant drop-in replacement for the original langid.py; skip if you need active development or support for languages outside the pre-trained set.

Install

py3langid on PyPI

pip

pip install py3langid

uv

uv add py3langid

poetry

poetry add py3langid

Installing py3langid

Before you install

Low friction: pure Python wheel with only numpy as a runtime dependency. Dormant maintenance (last release 787 days ago, last commit 2024-11-22), but stable and archived repository shows no active development pressure.

License in practice

BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution and license notice required in distributions.

Quickstart

pip install py3langid

import py3langid as langid
lang, prob = langid.classify('This text is in English.')
print(lang, prob)  # ('en', -56.77429)

Requires Python >= 3.8 and numpy; model loading on first use may take a moment.

Verify before relying

  • Whether the 30% import speedup and 25-30x model loading speedup claims are reproducible in current environments.
  • Accuracy consistency across the 97 supported languages and whether results degrade on mixed-language or code-heavy text.

Package facts

License BSD (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — numpy
Maintenance dormant — 787 days since the last release
Last repo commit
First released
Downloads 437,924/month — #6,663 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py3langid-0.3.0-py3-none-any.whl

Keywords: language detection, language identification, langid, langid.py

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Text Processing :: Linguistic

Tags

language detectionlanguage identificationdetect text languagemultilingual text classifierlangid fork pythonidentify language from text97 language detector
language-detectionnlp-preprocessingcli-tool

More Artificial Intelligence packages