--- id: fasttext-langdetect version: "1.1.1" license: MIT License Copyright (c) 2021 Zafer Çavdar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) license_treatment: permissive maintenance: active --- # fasttext-langdetect — 80x faster and 95% accurate language identification with fastText License: permissive · Maintenance: active · Downloads: 194.3K/mo ## What it is and what it does fasttext-langdetect wraps Facebook's pretrained fastText language identification model (lid.176) in a simple Python API. It detects which of 176 languages a given UTF-8 string is written in, returning a language code and confidence score. The package handles multi-line input and whitespace normalization automatically, and offers a low-memory mode using a compressed model variant for memory-constrained environments. The core use case is rapid, accurate language detection for text processing pipelines—content routing, multilingual NLP preprocessing, or user-generated content classification. It depends on fasttext-predict and requests, both of which install without compilation. Models are cached locally on first download and can be overridden via the FTLANG_CACHE environment variable. Use it for: - Route user-submitted text to language-specific NLP pipelines or translation services - Identify the language of social media posts or forum content for moderation or analysis - Detect bilingual or code-switched text by requesting top-k candidate languages - Preprocess multilingual datasets by filtering or grouping documents by detected language - Build a language-aware search or recommendation system that respects user language preference ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Identifies the language of UTF-8 text using Facebook's pretrained fastText lid.176 model, supporting 176 languages with optional memory-efficient compressed mode. Yes. Active maintenance, permissive MIT license, low install friction, no known vulnerabilities, and strong benchmark performance make this a solid choice for production language detection. The API is straightforward, and prebuilt wheels eliminate compilation overhead. Install it if you need fast, accurate language identification across 176 languages without external service calls. ## Install pip install fasttext-langdetect uv add fasttext-langdetect poetry add fasttext-langdetect ## Installing fasttext-langdetect Before you install: Low friction install with prebuilt wheels for all major platforms and Python versions 3.9–3.13; active maintenance with recent release 80 days ago and no compilation required. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects. Quickstart: pip install fasttext-langdetect from fasttext-langdetect import detect result = detect(text="Bugün hava çok güzel", low_memory=False) print(result) Requires Python 3.9 or newer; models download and cache on first use (network access required). Verify before relying: - Accuracy on code-switched or mixed-script text beyond the bilingual examples shown - Performance characteristics on very long documents or streaming scenarios - Behavior on text with heavy emoji, URLs, or special formatting - Whether the module import name differs from the package name ## Package facts - License: MIT License Copyright (c) 2021 Zafer Çavdar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 194.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags language detection, language identification, fasttext language, multilingual text classification, detect text language, language recognition, nlp language detection, language-detection, fasttext, multilingual [View on SkillFed](https://skillfed.io/packages/fasttext-langdetect) · [View on PyPI](https://pypi.org/project/fasttext-langdetect/)