registry

module of dascore.models source

The registry which lets a serialized document name the class it holds.

A document states its class in an object_type key holding a registered name, never an import path. A dotted path would weld stored documents to today’s module layout and make reading one an arbitrary-import surface; a registered name costs the same to write and has neither property.

Functions

Name Description
check_tag_matches Refuse a document whose tag names some other class.
get_model_tag Return the tag which names a model class in a document, if it has one.
register_model Add a model class to the registry under its derived tag.
registered_models Return the registered classes, keyed by the tag naming each.
resolve_model_tag Return the class a tag names, or None if nothing registers it.
resolve_tagged_model Return the model class a tag names.