A Python package for converting country names into emoji flags
Project description
countryflag
Countryflag is a Python package to convert country names into emoji flags.
Motivation
I'm new to Python and to programming in general, and I have lots of things to learn, but instead of exercising on "Hello World"-like trivial examples I wanted to create a "real" project from the beginning.
The idea was to build a simple command to get the correspondent emoji flag starting from a country name.
Installation
Countryflag is registered at PyPI. From the command line:
pip install countryflag --upgrade
Source code is also available on GitHub.
Usage
Countryflag accepts one or more country name(s) as command line arguments, separated by spaces.
Country names can be expressed in various classification schemes such as ISO-2, ISO-3, ISO-numeric, official name, etc.
Countryflag uses Country Converter (coco) to convert country names to ISO-2 codes before returning emoji flags, so please see Country Converter README.md for further details about supported classification schemes.
countryflag Germany BE Spain 'United States of America'
The default output is a space separated list of emoji flags, one for each country.
Compatible terminals
Some terminals, such as iTerm2 on Mac Os, support Emoji Flags very well.
However, many others don't, such as Windows Terminal on Windows or Gnome Terminal on Linux: instead of the flag, they display country initials.
At least on Windows, the reason seems to be political/PR-related, as explained here.
Therefore, countryflag makes much more sense on systems that can properly render Emoji flags in terminal.
Issues, bugs and enhancements
Please use the issue tracker for documenting bugs, proposing enhancements and all other communication related to countryflag.
Acknowledgements
This package depends on:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for countryflag-0.1.1rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d0b0291f21174f80c1552df28e35d804bc83268676ecbec809a61028de61a60 |
|
MD5 | e166a147349e1389f42fb43d9626bb5f |
|
BLAKE2b-256 | 73c63f12f2865f6b4154bf5d1c2d75042601c3cdb6547b8c50d4f23094ce20d5 |