{"id":21472,"library":"iso-639","title":"iso-639","description":"Python library for ISO 639 standard, providing mappings between language names, ISO 639-1 (alpha-2), ISO 639-2 (alpha-3), and ISO 639-3 codes. Version 0.4.5 is the latest release (as of 2025).","status":"active","version":"0.4.5","language":"python","source_language":"en","source_url":"https://github.com/noumar/iso639","tags":["ISO 639","language codes","localization"],"install":[{"cmd":"pip install iso-639","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"Lang is not the main class; Language is the correct class.","wrong":"from iso639 import Lang","symbol":"Language","correct":"from iso639 import Language"},{"note":"Importing the module directly gives access to custom exceptions like InvalidLanguageValue.","wrong":"","symbol":"iso639","correct":"import iso639"}],"quickstart":{"code":"from iso639 import Language\n\n# Search by name (case-insensitive)\nlang = Language('English')\nprint(lang.name)       # 'English'\nprint(lang.pt1)        # 'en'\nprint(lang.pt2b)       # 'eng'\nprint(lang.pt3)        # 'eng'\n\n# Search by ISO 639-1 code\nlang2 = Language('fr')\nprint(lang2.name)      # 'French'\n\n# Iterate all languages\nfor l in Language:\n    print(l.name, l.pt1)\n    break","lang":"python","description":"Instantiate a Language object with a name or code to access properties."},"warnings":[{"fix":"from iso639 import InvalidLanguageValue; try: Language('zzz') except InvalidLanguageValue: ...","message":"The library raises InvalidLanguageValue (not ValueError) if the input is not found. Catch the custom exception.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Use lang.pt2b for bibliographic code, lang.pt2t for terminology code.","message":"Some languages have multiple ISO 639-2 codes (B and T). Use .pt2b (bibliographic) and .pt2t (terminology) attributes.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace iso639.list_languages() with [l for l in Language]","message":"The old API with iso639.list_languages() is deprecated; use iteration over Language class.","severity":"deprecated","affected_versions":"<0.4.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from iso639 import Language'","cause":"Importing the iso639 module instead of the Language class from the iso639 submodule.","error":"AttributeError: module 'iso639' has no attribute 'Language'"},{"fix":"Ensure the language name/code is valid according to ISO 639. Use try/except with InvalidLanguageValue.","cause":"Passing an invalid language name or code to the Language constructor.","error":"iso639.errors.InvalidLanguageValue: The language value 'xyz' is not valid."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}