HomeDashboard/.venv/lib/python3.12/site-packages/nicegui/optional_features.py
2026-01-03 14:54:18 +01:00

26 lines
474 B
Python

from typing import Literal
_optional_features: set[str] = set()
FEATURE = Literal[
'highcharts',
'matplotlib',
'pandas',
'pillow',
'plotly',
'polars',
'pyecharts',
'redis',
'webview',
]
def register(feature: FEATURE) -> None:
"""Register an optional feature."""
_optional_features.add(feature)
def has(feature: FEATURE) -> bool:
"""Check if an optional feature is registered."""
return feature in _optional_features