Supported Types¶
Marshal¶
Type |
Description |
---|---|
Marshals a |
|
Marshals any instance of a primitive class or subclass into its baseclass value. |
|
|
Marshals an omegaconf |
Simply marshals any |
|
Marshals namedtuples into a mapping where the keys correspond to the field names of the namedtuple. Supports both |
|
Marshals a python logger into a mapping with keys |
|
Marshals an enum instance into its name. |
|
Marshals a datetime object into formatted string according to ISO. See |
|
Marshals a dataclass instance into a mapping with the field names as keys. |
|
Marshals a complex value into a dictionary with keys |
|
Marshals bytes into a URL-safe base64-encoded string. |
|
Unmarshals sequence values matched through ducktyping.Uses |
|
Unmarshals mapping values matched through ducktyping.Uses |
|
|
Fetches and marshals all items in an iterable. |
Unmarshal¶
Type |
Description |
---|---|
Unwraps and delegates unmarshaling to the underlying type. |
|
The union type which in later versions of python may be specified using the |
|
Unwraps the |
|
Unmarshals any subclass of |
|
Accepts input as strings in the python slicing format (i.e. “1:2”, “::-1” e.t.c). Also accepts keys “start”, “stop” and/or “step” or a sequence of up to 3 optional integer values. If a single integer is given, it is treated as “stop” |
|
Unmarshals a sequence input into a set. Any duplicate values will be discarded. |
|
Attempts to unmarshal |
|
Unmarshals any primitive class or its subclass. Special rules for |
|
A missing value is valid input as well as the |
|
Unmarshals namedtuple types from a mapping or sequence input. Supports both |
|
Unmarshals a sequence input into a fixed size tuple. The input sequence must contain the same number of elements as the tuple type specifies. |
|
A python logging.Logger. If no arguments are given the root logger is used. Takes either a single string which is used as name for the logger or a mapping with optional keys “name” and “level”. The level can be given as a string or an integer. |
|
Matches the input against the literal value(s), then returns the matched value. |
|
Input must match one of the enum values (the name or value). |
|
Unmarshals a sequence type from a sequence input. Should work for all sequence types. If the sequence type is one of the abstract sequence classes in collections.abc then a suitable replacement type is implicitly used instead. |
|
Unmarshals an input mapping into a defaultdict. If no default value is given in the type, all values default to |
|
Unmarshals a mapping type from a mapping input. Should work for all mapping types. If the mapping type is one of the abstract mapping classes in collections.abc then a suitable replacement type is implicitly used instead. |
|
For string inputs the format must be compatible with |
|
Expects a mapping input with the dataclass field names as keys. |
|
Expects a mapping with optional keys “real” and/or “imag” with float values or a sequence containing up to two float values, the first being the real value and the second being the imaginary value. If passed a float value instead of a mapping or sequence, it is treated as the real value. |
|
A valid (optionally URL-safe) base64-encoded string is expected as input. |
|
Any JSON-like data. Values should consist of one or more of the types |
|
|
Covers anything that is callable, be it a class, function or callable class instance. Callable arguments are inspected and the input should be a sequence or mapping(similar to *args or **kwargs). |
Unmarshals sequence types matched through ducktyping.Uses |
|
Unmarshals mapping types matched through ducktyping.Uses |