vertebrae.utils.serialization

Serialization helpers for reportable result objects and persisted metadata.

Functions

make_json_safe(value)

Convert supported scientific Python values into deterministic JSON data.

json_dumps_strict(value, *[, indent, sort_keys])

Normalize and serialize a value using standards-compliant JSON.

Module Contents

vertebrae.utils.serialization.make_json_safe(value)[source]

Convert supported scientific Python values into deterministic JSON data.

Unsupported values, cycles, and non-finite numbers fail with a path identifying the offending value. This function intentionally does not fall back to str.

Parameters:

value (Any)

Return type:

Any

vertebrae.utils.serialization.json_dumps_strict(value, *, indent=None, sort_keys=True)[source]

Normalize and serialize a value using standards-compliant JSON.

Parameters:
  • value (Any)

  • indent (Any)

  • sort_keys (bool)

Return type:

str