{"categories":[{"label":"Linguistic","url":"https://skillfed.io/packages/category/text-processing-linguistic"}],"enrichment":{"capability":"Parses, validates, and standardizes IETF language tags (BCP 47 format), converting between different representations of the same language and resolving deprecated or non-standard codes.","skillfed_tags":["language-processing","internationalization","standards-compliant"],"use_cases":["Normalize user-provided language preferences in web applications or APIs to canonical BCP 47 format for consistent storage and comparison.","Validate and correct language codes in multilingual content systems, replacing deprecated or misspelled codes with their modern equivalents.","Parse language tags to extract components (language, script, territory) for conditional logic in localization or content delivery pipelines.","Detect and handle language equivalences, such as treating 'zh-CN' and 'zh-Hans' interchangeably in Chinese text processing systems.","Build language selection dropdowns or autocomplete that accepts multiple input formats and normalizes them to standard codes."],"what_it_does":"Langcodes is a library for working with IETF language tags (standardized codes like 'en' for English, 'es' for Spanish, 'zh-Hans-CN' for Simplified Chinese in China). It implements BCP 47, the standard that subsumes ISO 639 and handles language variations, scripts, territories, and deprecated codes. The library solves the problem of language code equivalence: it knows that 'eng' and 'en' refer to the same language, that 'en-UK' is a misspelling that should map to 'en-GB', and that redundant script tags like 'en-Latn' can be shortened to 'en'.\n\nThe package provides two main interfaces: a `standardize_tag()` function that converts any language tag to its canonical BCP 47 form, and a `Language` class that parses tags into structured components (language, script, territory, variants, extensions, and private use codes). It validates tags against the IANA subtag registry, replacing deprecated values and handling complex substitutions like converting Serbo-Croatian to Serbian in Latin script. With no runtime dependencies and active maintenance, it's a lightweight tool for any application that needs to normalize or validate language identifiers.","worth_installing":"Yes. Langcodes is a stable, actively maintained library with no dependencies, permissive licensing, and strong popularity (top 5000 on PyPI). Install it if you work with language codes, multilingual systems, or need to normalize IETF language tags. The only minor consideration is whether you also need the optional language_data supplement for localized language names."},"id":"langcodes","links":{"html":"https://skillfed.io/packages/langcodes","md":"https://skillfed.io/packages/langcodes.md","pypi":"https://pypi.org/project/langcodes/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-12-02","license_spdx":null,"license_treatment":"permissive","name":"langcodes","python_support":"supports_current","summary":"Tools for labeling human languages with IETF language tags"},"popularity":{"monthly_downloads":12534804,"position":1314,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"3.5.1"}
