pywry.assets¶
Built-in asset loaders for Plotly, AG Grid, CSS, icons, toasts, and modals.
Plotly Assets¶
pywry.assets.get_plotly_js
cached
¶
Get the bundled Plotly.js library content.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The Plotly.js source code (full bundle with templates), or empty if not bundled. |
pywry.assets.get_plotly_templates_js
cached
¶
Get the bundled Plotly templates (plotly_dark, plotly_white).
| RETURNS | DESCRIPTION |
|---|---|
str
|
JavaScript that defines window.PYWRY_PLOTLY_TEMPLATES, or empty if not bundled. |
pywry.assets.get_plotly_defaults_js
cached
¶
Get the PyWry Plotly defaults JavaScript.
This is the SINGLE SOURCE OF TRUTH for all Plotly chart configuration and event handling. All rendering paths (notebook, inline, window) must include this.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The Plotly defaults JavaScript content. |
AG Grid Assets¶
pywry.assets.get_aggrid_js
cached
¶
Get the bundled AG Grid library content.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The minified AG Grid source code, or empty string if not bundled. |
pywry.assets.get_aggrid_css
cached
¶
get_aggrid_css(theme: str, mode: ThemeMode) -> str
Get the AG Grid CSS for a specific theme and mode.
| PARAMETER | DESCRIPTION |
|---|---|
theme
|
The AG Grid theme name (quartz, alpine, balham, material).
TYPE:
|
mode
|
The theme mode (light or dark).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The combined CSS content, or empty string if not found. |
pywry.assets.get_aggrid_defaults_js
cached
¶
Get the PyWry AG Grid defaults JavaScript.
This is the SINGLE SOURCE OF TRUTH for all AG Grid configuration. All rendering paths (notebook, inline, window) must include this.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The AG Grid defaults JavaScript content. |
Core CSS & JS¶
pywry.assets.get_pywry_css
cached
¶
Get the PyWry CSS content.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The PyWry CSS content, or empty if not found. |
pywry.assets.get_scrollbar_js
cached
¶
Get the custom scrollbar JavaScript content.
This provides macOS-style overlay scrollbars that work in both native windows and widget/iframe contexts.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The scrollbar JavaScript content, or empty if not found. |
Toast & Modal Assets¶
pywry.assets.get_toast_notifications_js
cached
¶
Get the PyWry Toast notification JavaScript.
This provides the PYWRY_TOAST object for showing typed toast notifications (info, success, warning, error, confirm).
| RETURNS | DESCRIPTION |
|---|---|
str
|
The toast notifications JavaScript content. |
pywry.assets.get_toast_css
cached
¶
Get the PyWry Toast CSS styles.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The toast CSS content. |
pywry.assets.get_modal_handlers_js
cached
¶
Get the PyWry Modal handlers JavaScript.
This provides the pywry.modal object for opening, closing, and managing modal overlays.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The modal handlers JavaScript content. |
Icons¶
pywry.assets.get_openbb_icon
cached
¶
Get the bundled OpenBB icon.
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
The icon file content as bytes, or empty bytes if not found. |
pywry.assets.get_openbb_icon_path
¶
Get the path to the bundled OpenBB icon.
| RETURNS | DESCRIPTION |
|---|---|
Path or None
|
The path to the icon file, or None if not found. |
Cache Management¶
pywry.assets.clear_css_cache
¶
Clear the cached CSS and JS content.
Call this after modifying pywry.css or scrollbar.js during development to force a reload on the next request.