Extra annotations

class dataclay.annotated.PropertyTransformer[source]

Parent class for annotations that transform object attributes.

This class is not intended to be used by itself, but instead inherited and implemented. Right now, this class is a trivial implementation, i.e. passthrough of getter and setter.

When the :method getter: is implemented, it will be used to transform the data during getattr operations.

Similarly, the :method setter: is used to transform the value during setattr operations.

getter(value)[source]

Transform the value during a getattr operation.

setter(value)[source]

Transform the value during a setattr operation.

class dataclay.annotated.LocalOnly[source]

Annotation to specify attributes that must no be persisted.

Example:

class ComplexAlgorithm(DataClayObject):
    primes_cache: Annotated[list[int], LocalOnly]