{"id":15357597,"url":"https://github.com/cvzi/flag","last_synced_at":"2025-10-16T06:58:27.522Z","repository":{"id":49199989,"uuid":"113705600","full_name":"cvzi/flag","owner":"cvzi","description":"Flag emoji from country codes for Python 🏳️‍🌈🌍","archived":false,"fork":false,"pushed_at":"2025-09-21T21:26:11.000Z","size":6816,"stargazers_count":62,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-21T22:17:18.500Z","etag":null,"topics":["country-codes","country-flags","emoji","flags","python","regional-indicator-symbols"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/emoji-country-flag/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cvzi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"cvzi","ko_fi":"cuzicvzi","liberapay":"cuzi","custom":["https://bandcamp.com/cuzi/wishlist","https://buymeacoff.ee/cuzi","https://live.blockcypher.com/btc/address/3KDs3RjvsKzbFQ8XoHkGqZxQtSxn2WYbn1/"],"patreon":"cuzi"}},"created_at":"2017-12-09T22:26:16.000Z","updated_at":"2025-09-21T21:26:15.000Z","dependencies_parsed_at":"2023-02-17T22:01:24.763Z","dependency_job_id":"2caae051-82cd-4140-801e-2a85b34949df","html_url":"https://github.com/cvzi/flag","commit_stats":{"total_commits":223,"total_committers":6,"mean_commits":"37.166666666666664","dds":"0.17488789237668156","last_synced_commit":"397b8a941a451f070ed353af30052a86d9f2bae1"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/cvzi/flag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvzi%2Fflag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvzi%2Fflag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvzi%2Fflag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvzi%2Fflag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cvzi","download_url":"https://codeload.github.com/cvzi/flag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvzi%2Fflag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279164038,"owners_count":26117593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["country-codes","country-flags","emoji","flags","python","regional-indicator-symbols"],"created_at":"2024-10-01T12:36:56.215Z","updated_at":"2025-10-16T06:58:27.493Z","avatar_url":"https://github.com/cvzi.png","language":"Python","readme":"flag\n====\n\n[![foodemoji on PyPI](https://img.shields.io/pypi/v/emoji-country-flag.svg)](https://pypi.python.org/pypi/emoji-country-flag)\n[![Python Versions](https://img.shields.io/pypi/pyversions/emoji-country-flag.svg)](https://pypi.python.org/pypi/emoji-country-flag)\n[![Coverage Status](https://coveralls.io/repos/github/cvzi/flag/badge.svg?branch=main)](https://coveralls.io/github/cvzi/flag?branch=main)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/6030d5de808c4fe2b2216699f1a7eafb)](https://app.codacy.com/gh/cvzi/flag/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Maintainability](https://api.codeclimate.com/v1/badges/cf1f88720896db4d1b0a/maintainability)](https://codeclimate.com/github/cvzi/flag)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=cvzi_flag\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=cvzi_flag)\n\nFlag emoji for Python.  \nConverts flag emoji to ASCII and other way round.\n\nThis is based on [http://schinckel.net/2015/10/29/unicode-flags-in-python/](http://web.archive.org/web/20180425063617/https://schinckel.net/2015/10/29/unicode-flags-in-python/) by [schinckel](https://github.com/schinckel/)\n\nHow it works\n------------\n\nAll the flag emoji are actually composed of two unicode letters. These are the 26 [regional indicator symbols](https://en.wikipedia.org/wiki/Regional_Indicator_Symbol).\n\nAlone they look like this:  \n🇦 🇧 🇨 🇩 🇪 🇫 🇬 🇭 🇮 🇯 🇰 🇱 🇲 🇳 🇴 🇵 🇶 🇷 🇸 🇹 🇺 🇻 🇼 🇽 🇾 🇿\n\nIf you pair them up according to ISO 3166 some browsers and phones will display a flag.  \nFor example TW is Taiwan: 🇹 + 🇼 = 🇹🇼\n\nSo, to encode an ASCII code like `:TW:` to 🇹🇼, we just need to convert the ASCII **T** and **W** to the corresponding regional indicator symbols 🇹 and 🇼.  \nTo reverse it, we translate the regional indicator symbols back to ASCII letters.\n\nExample\n-------\n\n```python\n    \u003e\u003e\u003e import flag\n    \n    \u003e\u003e\u003e flag.flag(\"IL\")\n    '🇮🇱'\n    \n    \u003e\u003e\u003e flag.flag(\"GBENG\")\n    '🏴󠁧󠁢󠁥󠁮󠁧󠁿'\n    \n    \u003e\u003e\u003e flag.flagize(\"Flag of Israel :IL:\")\n    'Flag of Israel 🇮🇱'\n    \n    \u003e\u003e\u003e flag.dflagize(\"Flag of Israel 🇮🇱\")\n    'Flag of Israel :IL:'\n    \n    \u003e\u003e\u003e flag.flagize(\"England :gb-eng: is part of the UK :GB:\", subregions=True)\n    'England 🏴󠁧󠁢󠁥󠁮󠁧󠁿 is part of the UK 🇬🇧'\n    \n    \u003e\u003e\u003e flag.dflagize(\"England 🏴󠁧󠁢󠁥󠁮󠁧󠁿 is part of the UK 🇬🇧\", subregions=True)\n    'England :gb-eng: is part of the UK :GB:'\n\n    \u003e\u003e\u003e my_flags = flag.Flag(only_supported=True, allow_subregions=True)\n    \u003e\u003e\u003e my_flags.flagize(\"Convert actual flags like :US: but not unsupported ones like :XX:\")\n    'Convert actual flags like 🇺🇸 but not unsupported ones like :XX:'\n```\n\nInstall\n-------\n\n`pip install emoji-country-flag`\n\nSee: [https://pypi.org/project/emoji-country-flag/](https://pypi.org/project/emoji-country-flag/)\n\nPython 3.10 or higher is required for the latest release.\nThe last release for Python 3.7 to 3.9 was [v1.3.2](https://github.com/cvzi/flag/releases/tag/v1.3.2).\nThe last release for Python 2.7, 3.4 and 3.5 was [v1.2.4](https://github.com/cvzi/flag/releases/tag/v1.2.4).\n\nDocumentation\n-------------\n\n[![Documentation Status](https://readthedocs.org/projects/flag/badge/?version=latest)](https://flag.readthedocs.io/en/latest/?badge=latest)\n\nDocumentation at [https://flag.readthedocs.io](https://flag.readthedocs.io)\n","funding_links":["https://github.com/sponsors/cvzi","https://ko-fi.com/cuzicvzi","https://liberapay.com/cuzi","https://bandcamp.com/cuzi/wishlist","https://buymeacoff.ee/cuzi","https://live.blockcypher.com/btc/address/3KDs3RjvsKzbFQ8XoHkGqZxQtSxn2WYbn1/","https://patreon.com/cuzi"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvzi%2Fflag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvzi%2Fflag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvzi%2Fflag/lists"}