desert package¶
Submodules¶
desert.exceptions module¶
-
exception
desert.exceptions.DesertException[source]¶ Bases:
ExceptionTop-level exception for desert.
-
exception
desert.exceptions.NotAnAttrsClassOrDataclass[source]¶ Bases:
desert.exceptions.DesertExceptionRaised for dataclass operations on non-dataclasses.
-
exception
desert.exceptions.UnknownType[source]¶ Bases:
desert.exceptions.DesertExceptionRaised for a type with unknown serialization equivalent.
Module contents¶
-
desert.field(marshmallow_field, **kw)[source]¶ Specify a marshmallow field in the metadata for a
dataclasses.dataclass.@dataclasses.dataclass class A: x: int = desert.field(marshmallow.fields.Int())
- Return type
-
desert.ib(marshmallow_field, **kw)[source]¶ Specify a marshmallow field in the metadata for an
attr.dataclass.@attr.dataclass class A: x: int = desert.ib(marshmallow.fields.Int())
- Return type
_CountingAttr
-
desert.metadata(field)[source]¶ Specify a marshmallow field in the field metadata.
x: int = attr.ib(metadata=desert.metadata(marshmallow.fields.Int()))