Serialization#

Classes used to support string serialization of Parameters and Parameterized objects.

param.serializer.JSONNullable(json_type)[source]#

Express a JSON schema type as nullable to easily support Parameters that allow_None.

class param.serializer.JSONSerialization[source]#

Class responsible for specifying JSON serialization, deserialization and JSON schemas for Parameters and Parameterized classes and objects.

classmethod array_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod calendardate_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod class__schema(class_: Any, safe: bool = False) dict[str, Any][source]#
classmethod classselector_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod dataframe_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod date_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod declare_numeric_bounds(schema: dict[str, Any], bounds: tuple[Any | None, Any | None] | None, inclusive_bounds: tuple[bool, bool]) dict[str, Any][source]#

Given an applicable numeric schema, augment with bounds information.

classmethod deserialize_parameter_value(pobj: Parameterized | type[Parameterized], pname: str, value: str) t.Any[source]#

Deserialize a single parameter value.

classmethod deserialize_parameters(pobj: Parameterized | type[Parameterized], serialized: str, subset: Iterable[str] | None = None) dict[str, t.Any][source]#

Deserialize a serialized object representing one or more Parameters into a dictionary of parameter values.

classmethod dict_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod dumps(obj: Any) str[source]#
classmethod integer_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
json_schema_literal_types = {<class 'NoneType'>: 'null', <class 'float'>: 'number', <class 'int'>: 'integer', <class 'str'>: 'string'}#
classmethod list_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod listselector_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod loads(serialized: str) Any[source]#
classmethod number_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod numerictuple_schema(p: Tuple, safe: bool = False) dict[str, t.Any][source]#
classmethod objectselector_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod param_schema(ptype: str, p: Parameter, safe: bool = False, subset: Iterable[str] | None = None) dict[str, t.Any][source]#
classmethod range_schema(p: Tuple, safe: bool = False) dict[str, t.Any][source]#
classmethod schema(pobj: Parameterized | type[Parameterized], subset: Iterable[str] | None = None, *, safe: bool = False) dict[str, t.Any][source]#
classmethod selector_schema(p: Parameter, safe: bool = False) dict[str, t.Any][source]#
classmethod serialize_parameter_value(pobj: Parameterized | type[Parameterized], pname: str) str[source]#

Serialize a single parameter value.

classmethod serialize_parameters(pobj: Parameterized | type[Parameterized], subset: Iterable[str] | None = None) str[source]#

Serialize the parameters on a Parameterized object into a single serialized object, e.g. a JSON string.

classmethod tuple_schema(p: Tuple, safe: bool = False) dict[str, t.Any][source]#
unserializable_parameter_types = ['Callable']#
classmethod xycoordinates_schema(p: Tuple, safe: bool = False) dict[str, t.Any][source]#
class param.serializer.Serialization[source]#

Base class used to implement different types of serialization.

classmethod deserialize_parameter_value(pobj: Parameterized | type[Parameterized], pname: str, value: str) t.Any[source]#

Deserialize a single parameter value.

classmethod deserialize_parameters(pobj: Parameterized | type[Parameterized], serialized: str, subset: Iterable[str] | None = None) dict[str, t.Any][source]#

Deserialize a serialized object representing one or more Parameters into a dictionary of parameter values.

classmethod schema(pobj: Parameterized | type[Parameterized], subset: Iterable[str] | None = None) dict[str, t.Any][source]#
classmethod serialize_parameter_value(pobj: Parameterized | type[Parameterized], pname: str) str[source]#

Serialize a single parameter value.

classmethod serialize_parameters(pobj: Parameterized | type[Parameterized], subset: Iterable[str] | None = None) str[source]#

Serialize the parameters on a Parameterized object into a single serialized object, e.g. a JSON string.

exception param.serializer.UnsafeserializableException[source]#
exception param.serializer.UnserializableException[source]#