UI Tools Module for FastPluggy
Optional utility plugin providing localization, image handling, and data rendering helpers.
Note (v0.1.0): Common widgets (Card, Grid, Stats, Status, Alert, Code, Progress) and generic Jinja filters (b64encode, nl2br, from_json) have been moved to fastpluggy core. Import them from
fastpluggy.core.widgets— no need to depend on this plugin for widgets.
What remains in ui-tools
Jinja Filters
| Filter | Description | Dependency |
|---|---|---|
pydantic_model_dump |
Dump Pydantic models/settings to dictionaries. | — |
localizedcurrency |
Format a number as localized currency (default: EUR, fr_FR). |
babel |
localizeddate |
Format dates/datetimes with various styles/locales/timezones. | babel |
Utility Functions
| Module | Function | Description |
|---|---|---|
template_tools |
render_bytes_size |
Format byte sizes as human-readable strings |
template_tools |
render_json_pre |
Render JSON in a <pre> block |
template_tools |
render_json_cell_modal |
Render JSON data with a modal preview button |
html_render |
render_data_field |
Render JSON/image data as HTML |
html_render |
render_safe_data_field |
Safely render arbitrary data |
image_tools |
Image detection/rendering | Base64 image detection and embedding |
localization |
Currency/date formatting | Babel-based localization helpers |
Requirements
License
MIT