functional
Class info¶
🛈 DocStrings¶
Functional API for looking up font icons.
get_icon
async
¶
get_icon(icon_name: str) -> Icon
Get a font icon, downloading the font on first use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon_name
|
str
|
Name in format "prefix.name" (e.g. "fa.heart") |
required |
Returns:
| Type | Description |
|---|---|
Icon
|
Icon with the Unicode character and the path to the font file |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the prefix is unknown or the icon does not exist |
Source code in src/pycons/functional.py
get_icon_from_iconify_id
async
¶
get_icon_from_iconify_id(iconify_id: str) -> Icon
Get an icon using an Iconify identifier format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
iconify_id
|
str
|
Icon identifier in Iconify format (e.g., "mdi:home" or "material-symbols:home-outline") |
required |
Returns:
| Type | Description |
|---|---|
Icon
|
Icon object |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the icon identifier is invalid or the icon is not found |