cvzi / flag Goto Github PK
View Code? Open in Web Editor NEWFlag emoji from country codes for Python π³οΈβππ
Home Page: https://pypi.org/project/emoji-country-flag/
License: MIT License
Flag emoji from country codes for Python π³οΈβππ
Home Page: https://pypi.org/project/emoji-country-flag/
License: MIT License
The country code CQ = Sark is in Unicode 16.0's list of flags / RGI list.
Unicode 16 will be finalized in September, and then it's up to the main emoji fonts to add support.
Is this something worth adding to flag/data/__init__.py
, or should it wait until it becomes more usable?
The flags work fine when I have a valid country code. If I create a dummy country Code which doesn't exist then how do I detect that?
If I do flag.flag(countrycode) it gets converted to two letter code irrespective of If it's valid or not.
But I don't want to display this two letter code in my UI. Just want to display the emoji if available
It would be nice if regional flags were supported with tag sequences.
For example, flag.flagize(':GB-ENG:')
would return π΄gbengβ¦
which would render as
when supported.
I have 3-letter country codes that I'd like to convert to emoji. The list looks lie this:
IND, NGA, KEN, ITA, USA, CUB, ZAF, GBR, POL, GHA, MAR, IDN, ESP, BRA, FRA
I understand that emoji uses two-letter country codes so I cut 3-letters to 2-letters (in most cases it works). But I faced the "black flag" problem.
If I try to get emoji from unknown 2 symbols, the library may return a black flag. How can I detect that?
Moreover there are a lot of symbols that looks like "black flag" so I can't use a simple ==
operator.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.