flag
Flag emoji for Python.
Converts flag emoji to ASCII and other way round.
This is based on http://schinckel.net/2015/10/29/unicode-flags-in-python/ by schinckel
How it works
All the flag emoji are actually composed of two unicode letters. These are the 26 regional indicator symbols.
Alone they look like this:
🇦 🇧 🇨 🇩 🇪 🇫 🇬 🇭 🇮 🇯 🇰 🇱 🇲 🇳 🇴 🇵 🇶 🇷 🇸 🇹 🇺 🇻 🇼 🇽 🇾 🇿
If you pair them up according to ISO 3166 some browsers and phones will display a flag.
For example CZ is Czechia: 🇨 + 🇿 = 🇨🇿
So, to encode an ASCII code like :NR: to 🇳🇷, we just need to convert the ASCII N and R to the corresponding regional indicator symbols 🇳 and 🇷.
To reverse it, we translate the regional indicator symbols back to ASCII letters.
Example
>>> import flag
>>> flag.flagize("Flag of Israel :IL:")
'Flag of Israel 🇮🇱'
>>> flag.dflagize(u"Flag of Israel 🇮🇱")
'Flag of Israel :IL:'
Install
pip install emoji-country-flag
Metadata
Release files for emoji-country-flag 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| emoji-country-flag-1.0.1.tar.gz | 4.1 kB | Without provenance | Details for emoji-country-flag-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| emoji_country_flag-1.0.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for emoji_country_flag-1.0.1-py2.py3-none-any.whl |
Total release size: 9.4 kB
Release files / emoji-country-flag-1.0.1.tar.gz
| Download URL | emoji-country-flag-1.0.1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
534c1582d07cf980b9e6da39251b1c638c5ec949eeba58a19d00a93985261378
|
|
BLAKE2b-256 checksum How to use checksums |
19fff6c8e2a2aa96b1ec8045b54a10af6967cc69cd46a57bc5585d20130d5cab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Release files / emoji_country_flag-1.0.1-py2.py3-none-any.whl
| Download URL | emoji_country_flag-1.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7636c115247525fe753df25b8b19e1a8cc3e93d563187142e0e982bc40eec417
|
|
BLAKE2b-256 checksum How to use checksums |
1f3cbbb727bb5ddbc9f77805e8d22d0f24f0f70eb792d6dc807c07e3721423a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Security for emoji-country-flag 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.