ESPHome Glyphsets

raw JSON →
0.2.0 verified Fri May 01 auth: no python

A lightweight library providing icon glyphsets for ESPHome displays, version 0.2.0. It packages Material Design Icons and other sets as compressed data for use on microcontrollers. Released as needed, currently experimental.

pip install esphome-glyphsets
error ModuleNotFoundError: No module named 'glyphsets'
cause Incorrect import path. The module is named 'esphome_glyphsets', not 'glyphsets'.
fix
Use from esphome_glyphsets import get_glyphs
error ImportError: cannot import name 'get_glyphs' from 'esphome_glyphsets'
cause Very old version might not have that function, or typo in function name.
fix
Check installed version: pip show esphome-glyphsets. Upgrade to 0.2.0 if older.
gotcha The PyPI package name uses hyphens (`esphome-glyphsets`), but the Python module name uses underscores (`esphome_glyphsets`). Using `import glyphsets` fails.
fix Import as `from esphome_glyphsets import ...`.
gotcha Glyph data may be in a compressed format specific to ESPHome; not all standard icon names are available. The set is limited to a subset of Material Design Icons.
fix List available icons via `get_glyphs('material_design_icons').keys()` before using.

Import glyphsets and retrieve a single icon code. The function 'get_glyphs' returns a dict mapping icon names to glyph data.

from esphome_glyphsets import get_glyphs
md_glyphs = get_glyphs('material_design_icons')
print(md_glyphs['home'])