Tools for deserialization
Todo
valuable.load.Registry[source]¶Interface for a loader registry.
Any callable with signature Type[T] -> Loader[T] implements it.
valuable.load.Loader[source]¶Interface for loaders (deserializers).
Any callable with the signature Any -> T implements Loader[T]
valuable.load.CombinableRegistry[source]¶base class for registries which may be combined
any callable implemeting the signature
(t.Type[T], Registry) -> Loader[T]
is combinable
also provides __or__ as a mixin method
valuable.load.PrimitiveRegistry(registry={})[source]¶a registry of primitive (i.e. non-nested) loaders
valuable.load.GenericRegistry(registry={})[source]¶registry for generic types. for example List.
These types must have __origin__ and __args__ attributes
valuable.load.AutoDataclassRegistry[source]¶registry which creates dataclass loaders on-the-fly
valuable.load.create_dataclass_loader(cls, registry, field_getters)[source]¶create a loader for a dataclass type
valuable.load.UnsupportedType[source]¶indicates the registry does not have a loader for the given type
valuable.load.lookup_defaults(lookup: typing.Callable[[typing.Any], T], default: T)[source]¶wrap a lookup function with a default if lookup fails
shortcuts for working with XML data
Miscellaneous tools, boilerplate, and shortcuts
valuable.utils.compose(*funcs: typing.Callable)[source]¶compose a function from a chain of functions
| Parameters: | *funcs – callables to compose |
|---|
Note
identity()