qilisdk.yaml

Attributes

yaml

Classes

QiliYAML

typ: 'rt'/None -> RoundTripLoader/RoundTripDumper, (default)

Functions

csr_representer(representer, data)

Representer for CSR matrix.

csr_constructor(constructor, node)

Constructor for CSR matrix.

ndarray_representer(representer, data)

Representer for ndarray

ndarray_constructor(constructor, node)

Constructor for ndarray

np_scalar_representer(representer, data)

Represent any NumPy scalar (e.g. np.int64, np.float32).

np_scalar_constructor(constructor, node)

Reconstruct a NumPy scalar.

defaultdict_representer(representer, data)

Represent a defaultdict by serializing its default_factory

defaultdict_constructor(constructor, node)

Reconstruct a defaultdict, restoring its factory and contents.

function_representer(representer, data)

Represent a non-lambda function by serializing it.

function_constructor(constructor, node)

Reconstruct a function from the serialized data.

lambda_representer(representer, data)

Represent a lambda function by serializing its code.

lambda_constructor(constructor, node)

Reconstruct a lambda function from the serialized data.

pydantic_model_representer(representer, data)

Representer for Pydantic Models.

pydantic_model_constructor(constructor, node)

Constructor for Pydantic Models.

complex_representer(representer, data)

complex_constructor(constructor, node)

tuple_representer(representer, data)

Representer for built-in Python tuple.

tuple_constructor(constructor, node)

Constructor for built-in Python tuple.

type_representer(representer, data)

Represent any Python class/type by its import path.

type_constructor(constructor, node)

Reconstruct a class/type from its import path.

deque_representer(representer, data)

Representer for deque

deque_constructor(constructor, node)

Constructor for ndarray

Module Contents

csr_representer(representer, data: scipy.sparse.csr_matrix)[source]

Representer for CSR matrix.

csr_constructor(constructor, node)[source]

Constructor for CSR matrix.

ndarray_representer(representer, data)[source]

Representer for ndarray

ndarray_constructor(constructor, node)[source]

Constructor for ndarray

np_scalar_representer(representer, data: numpy.generic)[source]

Represent any NumPy scalar (e.g. np.int64, np.float32).

np_scalar_constructor(constructor, node)[source]

Reconstruct a NumPy scalar.

defaultdict_representer(representer, data: collections.defaultdict)[source]

Represent a defaultdict by serializing its default_factory (as module+qualname) plus its items dict.

defaultdict_constructor(constructor, node)[source]

Reconstruct a defaultdict, restoring its factory and contents.

function_representer(representer, data)[source]

Represent a non-lambda function by serializing it.

function_constructor(constructor, node)[source]

Reconstruct a function from the serialized data.

lambda_representer(representer, data)[source]

Represent a lambda function by serializing its code.

lambda_constructor(constructor, node)[source]

Reconstruct a lambda function from the serialized data.

pydantic_model_representer(representer, data)[source]

Representer for Pydantic Models.

pydantic_model_constructor(constructor, node)[source]

Constructor for Pydantic Models.

complex_representer(representer, data: complex)[source]
complex_constructor(constructor, node)[source]
tuple_representer(representer, data: tuple)[source]

Representer for built-in Python tuple.

tuple_constructor(constructor, node)[source]

Constructor for built-in Python tuple.

type_representer(representer, data: type)[source]

Represent any Python class/type by its import path. E.g. datetime.datetime → ‘datetime.datetime’

type_constructor(constructor, node)[source]

Reconstruct a class/type from its import path.

deque_representer(representer, data)[source]

Representer for deque

deque_constructor(constructor, node)[source]

Constructor for ndarray

class QiliYAML(*, typ: List[Text] | Text | None = None, pure: Any = False, output: Any = None, plug_ins: Any = None)[source]

Bases: ruamel.yaml.YAML

typ: ‘rt’/None -> RoundTripLoader/RoundTripDumper, (default)

‘safe’ -> SafeLoader/SafeDumper, ‘unsafe’ -> normal/unsafe Loader/Dumper (pending deprecation) ‘full’ -> full Dumper only, including python built-ins that are

potentially unsafe to load

‘base’ -> baseloader

pure: if True only use Python modules input/output: needed to work as context manager plug_ins: a list of plug-in files

register_class(cls=None, *, shared: bool = False)[source]

register a class for dumping/loading - if it has attribute yaml_tag use that to register, else use class name - if it has methods to_yaml/from_yaml use those to dump/load else dump attributes

as mapping

yaml[source]