Lucide icons as FastHTML SVG components with category/tag registry and factory API.
Project description
cjm-fasthtml-lucide-icons
Install
pip install cjm_fasthtml_lucide_icons
Project Structure
nbs/
├── registry/ (3)
│ ├── categories.ipynb # Auto-generated category index for Lucide icons.
│ ├── icons.ipynb # Auto-generated registry of Lucide icon data.
│ └── tags.ipynb # Auto-generated tag index for Lucide icons.
├── core.ipynb # Data structures for representing Lucide icon elements and metadata.
├── factory.ipynb # SVG factory function for building FastHTML Lucide icon components.
└── utils.ipynb # Discovery utilities for browsing and searching available Lucide icons.
Total: 6 notebooks across 1 directory
Module Dependencies
graph LR
core[core<br/>core]
factory[factory<br/>factory]
registry_categories[registry.categories<br/>registry.categories]
registry_icons[registry.icons<br/>registry.icons]
registry_tags[registry.tags<br/>registry.tags]
utils[utils<br/>utils]
factory --> core
registry_icons --> core
utils --> registry_icons
utils --> registry_tags
utils --> registry_categories
5 cross-module dependencies detected
CLI Reference
No CLI commands found in this project.
Module Overview
Detailed documentation for each module in the project:
registry.categories (categories.ipynb)
Auto-generated category index for Lucide icons.
Import
from cjm_fasthtml_lucide_icons.registry.categories import (
CATEGORIES
)
Variables
CATEGORIES: Dict[str, List[str]]
core (core.ipynb)
Data structures for representing Lucide icon elements and metadata.
Import
from cjm_fasthtml_lucide_icons.core import (
SvgElement,
PathElement,
CircleElement,
RectElement,
LineElement,
EllipseElement,
PolylineElement,
PolygonElement,
IconData
)
Classes
@dataclass
class PathElement:
"SVG path element data."
d: str # path data string
@dataclass
class CircleElement:
"SVG circle element data."
cx: str # center x coordinate
cy: str # center y coordinate
r: str # radius
@dataclass
class RectElement:
"SVG rect element data."
x: str # x position
y: str # y position
width: str # width
height: str # height
rx: Optional[str] # corner radius (optional)
@dataclass
class LineElement:
"SVG line element data."
x1: str # start x
y1: str # start y
x2: str # end x
y2: str # end y
@dataclass
class EllipseElement:
"SVG ellipse element data."
cx: str # center x coordinate
cy: str # center y coordinate
rx: str # x radius
ry: str # y radius
@dataclass
class PolylineElement:
"SVG polyline element data."
points: str # space-separated coordinate pairs
@dataclass
class PolygonElement:
"SVG polygon element data."
points: str # space-separated coordinate pairs
@dataclass
class IconData:
"Container for a Lucide icon's SVG elements and metadata."
elements: List[SvgElement] # SVG child elements
categories: List[str] = field(...) # category assignments
tags: List[str] = field(...) # searchable tags
factory (factory.ipynb)
SVG factory function for building FastHTML Lucide icon components.
Import
from cjm_fasthtml_lucide_icons.factory import (
lucide_icon
)
Functions
def _build_element(
element: SvgElement # element dataclass to convert
): # FastHTML SVG element component
"Convert an element dataclass to a FastHTML SVG component."
def _build_svg(
icon_data: IconData, # icon data containing SVG elements
size: int = 5, # Tailwind size scale (default 5 = 20px)
cls: str = None, # additional CSS classes
**kwargs # additional SVG attributes
) -> Svg: # FastHTML Svg component
"Build a FastHTML Svg component from IconData."
def lucide_icon(
name: str, # icon name (e.g., "folder", "arrow-up")
size: int = 5, # Tailwind size scale (default 5 = 20px)
cls: str = None, # additional CSS classes (e.g., daisyUI colors)
**kwargs # additional SVG attributes
) -> Svg: # FastHTML Svg component
"Get a Lucide icon as a FastHTML Svg component."
registry.icons (icons.ipynb)
Auto-generated registry of Lucide icon data.
Import
from cjm_fasthtml_lucide_icons.registry.icons import (
ICONS
)
Variables
ICONS: Dict[str, IconData]
registry.tags (tags.ipynb)
Auto-generated tag index for Lucide icons.
Import
from cjm_fasthtml_lucide_icons.registry.tags import (
TAGS
)
Variables
TAGS: Dict[str, List[str]]
utils (utils.ipynb)
Discovery utilities for browsing and searching available Lucide icons.
Import
from cjm_fasthtml_lucide_icons.utils import (
list_icons,
icon_count,
get_categories,
category_count,
search_icons,
get_tags,
tag_count,
get_icon_categories,
get_icon_tags
)
Functions
def list_icons(
category: Optional[str] = None # filter by category name (optional)
) -> List[str]: # sorted list of icon names
"List available icon names, optionally filtered by category."
def icon_count(
category: Optional[str] = None # filter by category name (optional)
) -> int: # number of icons
"Get the count of available icons, optionally filtered by category."
def get_categories() -> List[str]: # sorted list of category names
"List all available category names."
def category_count() -> int: # number of categories
"Get the count of available categories."
def search_icons(
tag: str # tag to search for
) -> List[str]: # sorted list of icon names with that tag
"Search for icons by tag."
def get_tags() -> List[str]: # sorted list of all tags
"List all available tags."
def tag_count() -> int: # number of tags
"Get the count of available tags."
def get_icon_categories(
name: str # icon name
) -> List[str]: # categories the icon belongs to
"Get the categories an icon belongs to."
def get_icon_tags(
name: str # icon name
) -> List[str]: # tags assigned to the icon
"Get the tags assigned to an icon."
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cjm_fasthtml_lucide_icons-0.0.1.tar.gz.
File metadata
- Download URL: cjm_fasthtml_lucide_icons-0.0.1.tar.gz
- Upload date:
- Size: 198.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6792415569fc36d72022aa2f28fbddaa624d5402e293f6cda42f5a9a325efda
|
|
| MD5 |
3a80591c3e5867228799b331bd2dd1b7
|
|
| BLAKE2b-256 |
2cc5fae376ebc6669581b61637c54fed3d9f93e695063db875fa1d0374835a07
|
File details
Details for the file cjm_fasthtml_lucide_icons-0.0.1-py3-none-any.whl.
File metadata
- Download URL: cjm_fasthtml_lucide_icons-0.0.1-py3-none-any.whl
- Upload date:
- Size: 201.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
512b10cd5adb6d71c674784a5f2874ae3157f8508fe7ac352d4504cdbaaeb2c9
|
|
| MD5 |
741f614368ee261b149a7f5c14ed4b01
|
|
| BLAKE2b-256 |
ad6a7c05debb472ea23906c4055199ec9f2d9be1ca3cfaa10655ff88a0270417
|