cattr.preconf package

Submodules

cattr.preconf.bson module

Preconfigured converters for bson.

cattr.preconf.bson.configure_converter(converter: cattr.converters.GenConverter)[source]

Configure the converter for use with the bson library.

  • sets are serialized as lists

  • mapping keys are coerced into strings when unstructuring

cattr.preconf.bson.make_converter(*args, **kwargs) cattr.converters.GenConverter[source]

cattr.preconf.json module

Preconfigured converters for the stdlib json.

cattr.preconf.json.configure_converter(converter: cattr.converters.Converter)[source]

Configure the converter for use with the stdlib json module.

  • bytes are serialized as base64 strings

  • datetimes are serialized as ISO 8601

  • counters are serialized as dicts

  • sets are serialized as lists

cattr.preconf.json.make_converter(*args, **kwargs) cattr.converters.GenConverter[source]

cattr.preconf.msgpack module

Preconfigured converters for msgpack.

cattr.preconf.msgpack.configure_converter(converter: cattr.converters.GenConverter)[source]

Configure the converter for use with the msgpack library.

  • datetimes are serialized as timestamp floats

  • sets are serialized as lists

cattr.preconf.msgpack.make_converter(*args, **kwargs) cattr.converters.GenConverter[source]

cattr.preconf.orjson module

Preconfigured converters for orjson.

cattr.preconf.orjson.configure_converter(converter: cattr.converters.GenConverter)[source]

Configure the converter for use with the orjson library.

  • bytes are serialized as base85 strings

  • datetimes are serialized as ISO 8601

  • sets are serialized as lists

  • mapping keys are coerced into strings when unstructuring

cattr.preconf.orjson.make_converter(*args, **kwargs) cattr.converters.GenConverter[source]

cattr.preconf.pyyaml module

Preconfigured converters for pyyaml.

cattr.preconf.pyyaml.configure_converter(converter: cattr.converters.GenConverter)[source]

Configure the converter for use with the pyyaml library.

  • frozensets are serialized as lists

  • string enums are converted into strings explicitly

cattr.preconf.pyyaml.make_converter(*args, **kwargs) cattr.converters.GenConverter[source]

cattr.preconf.tomlkit module

Preconfigured converters for tomlkit.

cattr.preconf.tomlkit.configure_converter(converter: cattr.converters.GenConverter)[source]

Configure the converter for use with the tomlkit library.

  • bytes are serialized as base85 strings

  • sets are serialized as lists

  • tuples are serializas as lists

  • mapping keys are coerced into strings when unstructuring

cattr.preconf.tomlkit.make_converter(*args, **kwargs) cattr.converters.GenConverter[source]

cattr.preconf.ujson module

Preconfigured converters for ujson.

cattr.preconf.ujson.configure_converter(converter: cattr.converters.Converter)[source]

Configure the converter for use with the ujson library.

  • bytes are serialized as base64 strings

  • datetimes are serialized as ISO 8601

  • sets are serialized as lists

cattr.preconf.ujson.make_converter(*args, **kwargs) cattr.converters.GenConverter[source]

Module contents

cattr.preconf.validate_datetime(v, _)[source]