v3.15.0
guidata Version 3.15.0
✨ New features:
-
JSON Schema export for
DataSetclasses — added a newguidata.dataset.jsonschemamodule that converts anyDataSetsubclass into a UI-framework-agnosticJSON Schema 2020-12document, augmented withx-guidata-*extension keywords for guidata-specific concerns (groups, tabs, units, choice labels, dynamic choices, image icons, layout tree). Public API:dataset_to_schema()(class → schema),dataset_to_schema_with_values()(instance → schema + current values),resolve_dynamic_choices()(resolve aChoiceItemwhose choices are computed by a callable).dataset_to_schema_with_values()accepts an optionalexclude_value_kindscollection to omit expensive values from the payload while preserving their schema properties. All three helpers are re-exported fromguidata.dataset. Items requiring callables that cannot cross JSON (ButtonItem, conditional visibility through callableactiveprops) raiseNotImplementedError. This enables non-Qt frontends — typically a browser/React UI driven by Pyodide — to render guidataDataSetdeclarations natively while keeping a single source of truth. -
Pluggable UI backend for
DataSetdialogs — added a newguidata.dataset.backendsmodule that exposes a small handler registry consulted byDataSet.edit(),DataSet.view()andDataSetGroup.edit()before falling back to the existing Qt dialogs. Applications can register handlers for the"edit_dataset","view_dataset"and"edit_dataset_group"slots to plug an alternate UI (web, CLI, notebook, …) without modifying the Qt path used by existing applications. When no handler is registered, behaviour is byte-for-byte identical to previous releases. Public API:set_handler(),get_handler(),has_handler(),clear_handler(),clear_all_handlers(). -
Asynchronous
DataSet.edit_async()— added a coroutine variant ofDataSet.edit()for environments whose event loop cannot block the calling thread (typically browser/JavaScript frontends). When an"edit_dataset_async"handler is registered inguidata.dataset.backends, it is awaited and its result returned; otherwiseedit_async()falls back to the synchronousedit(), so it is always safe to call. -
Strict and version-aware DataSet JSON deserialization —
json_to_dataset()now provides an opt-in strict mode that validates class identity, persisted field names, nested values, and application-owned schema versions before constructing aDataSet. Validation failures expose structured missing, unknown, and invalid field diagnostics. Applications may explicitly allow compatible additions to use defaults and may migrate a copy of historical payloads, with the migrated result revalidated before loading. Existing calls remain permissive and existing JSON does not require a version. See the DataSet conversion helpers documentation for usage and migration examples.