Skip to main content
Version: 0.6

schema

superduper.misc.schema

Source code

process​

process(annotation)
ParameterDescription
annotationThe annotation to process.

Process an annotation with a crude mapping to workable superduper types.

Output is expected as a tuple of base type and iterable over that type.

import typing as t
from superduper import Model, Component
process(Model)
# (superduper.components.model.Model, None)
process(Model | None)
# (superduper.components.model.Model, None)
process(t.List[str])
# (str, list)
process(t.Dict[str, Component])
# (superduper.components.component.Component, dict)
process(t.Dict[str, MyClass])
# (my_path.to_module.MyClass, dict)

gather_mro_globals​

gather_mro_globals(cls)
ParameterDescription
clsThe class to gather the MRO globals from.

Return a merged dictionary of the module global from the MRO of cls.

get_schema​

get_schema(cls)
ParameterDescription
clsThe class to get a schema for.

Get a schema for a superduper class.