mpl-flags
National flags for Matplotlib.
Flags data
mpl-flags contains the flag data in vector format readily usable with
Matplotlib. The original flags data are in svg format, and are converted to
matplotlib's Path data using mpl-simple-svg-parser. mpl-flags does not
contain the original svg files, only the converted data in numpy format
(vertices and codes).
The flag data is collected from various sources. Currently, it includes flags from
- Google's noto color emoji font : https://github.com/googlefonts/noto-emoji
- circle-flags : https://github.com/HatScripts/circle-flags
- flag-icons : https://github.com/lipis/flag-icons
Different sources can render the flags differently.
Usage
from mpl_flags import Flags
flags = Flags("noto_waved") # You initialize the Flags class specifying what kind of
# flags you like to use.
# `noto_waved` is flags from google's noto emoji fonts.
fig, ax = plt.subplots(figsize=(3, 3))
flags.show_flag(ax, "KR")
from matplotlib.offsetbox import AnnotationBbox
flags = Flags("noto_original")
fig, ax = plt.subplots(figsize=(3, 3))
da = flags.get_drawing_area("KR", wmax=100)
ab = AnnotationBbox(da, (0.5, 0.5), frameon=True,
box_alignment=(0.5, 0.5))
ax.add_artist(ab)
Installation
You can install using pip:
pip install mpl_flags
Development Installation
pip install -e ".[dev]"
Metadata
Release files for mpl-flags 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mpl_flags-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / mpl_flags-0.1.0-py3-none-any.whl
| Download URL | mpl_flags-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e25a2df1d2da1131a235dfefec87512e763843e65bae1923c2a568a8346cc0b1
|
|
BLAKE2b-256 checksum How to use checksums |
3cb453f60fac7a296a269543ace9be30c05504e1c3b5f9f38c484355563904ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Security for mpl-flags 0.1.0
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.