Module preprocessor.isdict

The abstract class IsDict defines the to_dict from_dict interfaces used by other abstract methods in this module in abstract.py and concrete classes defined by custom preprocessors.

Classes

class IsDict

Abstract base for any object that can be converted into and out of a dict.

If schema validation is possible for the derived type, the schema definition should be in a class variable named SCHEMA.

Ancestors

  • abc.ABC

Subclasses

Static methods

def from_dict(input: dict) -> Any

Converts a Python dict into the type.

Args

input : dict
The output of a serializer like json.load()

Returns

Any
The specific type which implemented this interface.

Methods

def to_dict(self) -> dict

Converts the type into a Python dict for serialization.

Returns

dict
Python dict which can be passed to serializers like json.dump()