{"id":23666,"library":"emoji-country-flag","title":"emoji-country-flag","description":"Encode/decode unicode country flag emoji. Version 2.1.0; supports Python >=3.10. Regularly updated to match ISO 3166-1 changes.","status":"active","version":"2.1.0","language":"python","source_language":"en","source_url":"https://github.com/laem/emoji-country-flag","tags":["emoji","country-flag","unicode","iso-3166"],"install":[{"cmd":"pip install emoji-country-flag","lang":"bash","label":"Latest stable"}],"dependencies":[],"imports":[{"note":"older versions required submodule path","wrong":"from emoji_country_flag.flags import Flag","symbol":"Flag","correct":"from emoji_country_flag import Flag"},{"note":"incorrect submodule path","wrong":"from emoji_country_flag.flag import get_flag","symbol":"get_flag","correct":"from emoji_country_flag import get_flag"},{"note":"incorrect submodule path","wrong":"from emoji_country_flag.utils import decode_flag","symbol":"decode_flag","correct":"from emoji_country_flag import decode_flag"}],"quickstart":{"code":"from emoji_country_flag import Flag\n\nflag = Flag(code='US')\nprint(flag.emoji)  # 🇺🇸\n\n# or using get_flag\nfrom emoji_country_flag import get_flag, decode_flag\nemoji = get_flag('US')\nprint(emoji)  # 🇺🇸\ncode = decode_flag(emoji)\nprint(code)  # US","lang":"python","description":"Create a Flag object or use functions to encode country code to emoji and decode emoji to country code."},"warnings":[{"fix":"Upgrade to Python 3.10+ or pin to version 1.x (e.g., pip install 'emoji-country-flag<2')","message":"Version 2.0.0+ requires Python 3.10 or later. Python 3.6-3.9 no longer supported.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use `Flag(code).emoji` instead of `get_flag(code)`.","message":"The function `get_flag()` is deprecated in favor of `Flag()` class in version 1.2.0+.","severity":"deprecated","affected_versions":">=1.2.0"},{"fix":"Always use uppercase two-letter codes (e.g., 'US', 'GB').","message":"Country codes must be ISO 3166-1 alpha-2 uppercase. Lowercase or full country names are not recognized.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from emoji_country_flag import get_flag` (if version <1.2.0) or use `Flag` class.","cause":"Importing from the wrong submodule or using incorrect function name; get_flag may not exist in newer versions.","error":"AttributeError: module 'emoji_country_flag' has no attribute 'get_flag'"},{"fix":"Use uppercase letters, e.g., 'US' instead of 'us'.","cause":"Country code must be uppercase.","error":"ValueError: Invalid country code: us"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}