Tabler Icons library for Python.
Tabler Icons is a set of free MIT-licensed high-quality SVG icons. Each icon is designed on a 24x24 grid and a 2px stroke.
pip install tablerpy
The function tablerpy.get_icon
accepts a OutlineIcon | FilledIcon
and return a Traversable
(pathlib.Path
) to the icon .svg
file.
from tablerpy import OutlineIcon, FilledIcon, get_icon
outline_icon_path = get_icon(OutlineIcon.BRAND_GITHUB)
filled_icon_path = get_icon(FilledIcon.BRAND_GITHUB)
Icon names match those on tabler.io/icons,
except they are uppercased and hyphens -
are replaced with underscores _
.
For example, brand-github
becomes BRAND_GITHUB
.
To keep up with Tabler Icons releases, most of this package is generated using a script.
$ python scripts/generator.py --help
usage: generator.py [-h] --version VERSION [--package PACKAGE]
Download Tabler Icons release from github.com/tabler/tabler-icons and generate Python files.
options:
-h, --help show this help message and exit
--version VERSION Tabler Icons release version
--package PACKAGE Target package directory
For instance, to generate files from Tabler Icons Release 3.29.0:
python scripts/generator.py --version 3.29.0
- pytablericons
for providing inspiration.
The package include features for using icons with
Pillow
,PyQt
orPySide
.