{"library":"py3langid","title":"py3langid","description":"py3langid is an actively maintained fork of the original `langid.py` library, specializing in fast and accurate language identification. It is optimized for Python 3 environments, featuring a modernized codebase and improved execution speeds. The library's current version is 0.3.0, with a release cadence that reflects ongoing enhancements and bug fixes.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install py3langid"],"cli":{"name":"langid","version":"usage: langid [-h] [-s] [--host HOST] [--port PORT] [-v] [-m MODEL] [-l LANGS]"}},"imports":["import py3langid as langid\nlangid.classify(text)","from py3langid.langid import LanguageIdentifier, MODEL_FILE"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import py3langid as langid\n\ntext_en = 'This text is in English.'\nlang, prob = langid.classify(text_en)\nprint(f\"Text: '{text_en}' -> Language: {lang}, Probability: {prob}\")\n\ntext_de = 'Dieser Text ist auf Deutsch.'\nlang, prob = langid.classify(text_de)\nprint(f\"Text: '{text_de}' -> Language: {lang}, Probability: {prob}\")\n\n# Example with probability normalization\nfrom py3langid.langid import LanguageIdentifier, MODEL_FILE\nidentifier = LanguageIdentifier.from_pickled_model(MODEL_FILE, norm_probs=True)\ntext_norm = 'This should be enough text.'\nlang_norm, prob_norm = identifier.classify(text_norm)\nprint(f\"Text (normalized): '{text_norm}' -> Language: {lang_norm}, Normalized Probability: {prob_norm}\")","lang":"python","description":"This quickstart demonstrates basic language classification using `py3langid.classify()`. It also shows how to use `LanguageIdentifier` for more control, such as enabling probability normalization to get scores between 0 and 1.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}