emoji-country-flag
En/Decode unicode country flags emoji
Decision gist · record as of 2026-08-14
Yes. Low install friction, no dependencies, permissive MIT license, active maintenance, and no known vulnerabilities make this a safe choice. Install if you need bidirectional flag emoji–to–ASCII conversion; skip if your application doesn't work with country codes or emoji representation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or higher; earlier Python versions (3.7–3.9) are limited to v1.3.2.
- Low friction: pure Python wheel with no runtime dependencies.
- Actively maintained as of 2026-07-30 with recent release (2025-09-21).
License · maintenance · safety
MIT (permissive) — MIT license (permissive) allows use in commercial and private projects with minimal restrictions—include a copy of the license and you're clear.
last release 2025-09-21 (327 days) · last repo commit 2026-07-30 · 67 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 93,036 downloads/mo, #13,405 on PyPI
Alternatives
Verify before relying
pip install emoji-country-flag
import flag
flag.flag("IL") # Returns '🇮🇱'
flag.flagize("Flag of Israel :IL:") # Returns 'Flag of Israel 🇮🇱'
flag.dflagize("Flag of Israel 🇮🇱") # Returns 'Flag of Israel :IL:'- Whether all ISO 3166 country codes are supported or only a subset.
- Performance characteristics when processing large strings with many flag conversions.
- Behavior with unsupported country codes or malformed input.
What it is and what it does
emoji-country-flag is a lightweight utility for bidirectional conversion between flag emoji and their ASCII representations. It works by mapping ISO 3166 country codes (like `:US:` or `:GB:`) to pairs of Unicode regional indicator symbols, which browsers and phones render as flag emoji. The package provides three main operations: converting a code to an emoji, embedding emoji into text by replacing ASCII notation, and extracting ASCII notation back from emoji-containing text.
The package has no runtime dependencies and installs as a pure Python wheel. It supports current Python versions (3.10+) and is actively maintained. It's useful for applications that need to store or transmit flag representations in a portable text format, or for user interfaces that want to convert between human-readable country codes and visual emoji.
Use it for
- Store country flags in databases or config files as portable `:XX:` codes instead of emoji characters.
- Convert user input containing flag emoji back to ASCII codes for processing or storage.
- Embed country flags into chat messages or text by replacing `:US:` with 🇺🇸 before display.
- Support subregion flags (e.g., `:gb-eng:` for England) in applications that need finer geographic granularity.
- Build text-based templates or markdown that render flags only when converted to emoji for display.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Low install friction, no dependencies, permissive MIT license, active maintenance, and no known vulnerabilities make this a safe choice. Install if you need bidirectional flag emoji–to–ASCII conversion; skip if your application doesn't work with country codes or emoji representation.
Install
emoji-country-flag on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of 2026-07-30 with recent release (2025-09-21). Requires Python 3.10 or higher for current versions.
Requires Python 3.10 or higher; earlier Python versions (3.7–3.9) are limited to v1.3.2.
License in practice
MIT license (permissive) allows use in commercial and private projects with minimal restrictions—include a copy of the license and you're clear.
Quickstart
pip install emoji-country-flag
import flag
flag.flag("IL") # Returns '🇮🇱'
flag.flagize("Flag of Israel :IL:") # Returns 'Flag of Israel 🇮🇱'
flag.dflagize("Flag of Israel 🇮🇱") # Returns 'Flag of Israel :IL:'
Verify before relying
- Whether all ISO 3166 country codes are supported or only a subset.
- Performance characteristics when processing large strings with many flag conversions.
- Behavior with unsupported country codes or malformed input.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 327 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 93,036 / month, #13,405 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Communications :: ChatTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: PrintingTopic :: Text Processing :: GeneralTyping :: Typed |
Evidence: emoji_country_flag-2.1.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “flag emoji conversion”
- emoji-country-flagConverts between flag emoji and ASCII country codes (e.g., `:US:` ↔…
- demojidemoji finds and removes emojis from text, mapping each emoji to its…
- emojiConverts between emoji characters and their text code names (e.g.,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Dynamic Content packages
MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.
Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.
Soupsieve is a CSS selector library designed to work with Beautiful Soup 4 to select, match, and filter HTML and XML elements using modern CSS selectors from CSS level 1 through CSS level 4 specifications.
Install it if you use Beautiful Soup for HTML or XML parsing and want modern CSS selector support.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
Flask is a lightweight WSGI web application framework for building web applications in Python, from simple single-page sites to complex multi-route applications.
Mako compiles Python-embedded templates into Python modules for fast rendering, supporting layout inheritance, custom functions, and direct Python expressions within template syntax.
See also anyascii · idna · emoji · Unidecode · ecoji · demoji · fold-to-ascii · pycountry-convert · pycountry · sphinxemoji