Skip to content

icons

Class info

🛈 DocStrings

load_icon_index

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

Load the complete icon index from disk.

Source code in src/jinjarope/icons.py
88
89
90
91
92
93
94
def load_icon_index() -> dict[str, dict[str, str]]:
    """Load the complete icon index from disk."""
    import gzip
    import json

    with gzip.open(ICON_FILE, "r") as file:
        return json.loads(file.read())

write_icon_index

write_icon_index()

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

Source code in src/jinjarope/icons.py
78
79
80
81
82
83
84
85
def write_icon_index():
    """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())