Skip to content

icons

Class info

🛈 DocStrings

load_icon_index cached

load_icon_index() -> dict[str, dict[str, str]]

Load the complete icon index from disk.

Source code in src/jinjarope/icons.py
@functools.cache
def load_icon_index() -> dict[str, dict[str, str]]:
    """Load the complete icon index from disk."""
    import gzip

    import anyenv

    with gzip.open(ICON_FILE, "r") as file:
        index: dict[str, dict[str, str]] = anyenv.load_json(file.read())
    return index

write_icon_index

write_icon_index() -> None

Fetch the complete icon index and write it gzipped to disk.

Source code in src/jinjarope/icons.py
def write_icon_index() -> None:
    """Fetch the complete icon index and write it gzipped to disk."""
    import gzip
    import json

    mapping = _get_pyconify_icon_index()
    with gzip.open(ICON_FILE, "w") as file:
        file.write(json.dumps(mapping).encode())