Skip to content

Types

pyrmute exports some convenience types to make annotation more concise and descriptive.

You can import them directly from pyrmute:

from pyrmute import (
    JsonSchema,
    JsonSchemaMode,
    MigrationFunc,
    ModelData,
    NestedModelInfo,
)

pyrmute.ModelData module-attribute

ModelData = dict[str, Any]

pyrmute.JsonSchema module-attribute

JsonSchema = dict[str, JsonValue]

pyrmute.JsonSchemaMode module-attribute

JsonSchemaMode = Literal['validation', 'serialization']

pyrmute.NestedModelInfo dataclass

NestedModelInfo(name, version)

Contains information about nested models.

name instance-attribute

name

version instance-attribute

version

pyrmute.MigrationFunc module-attribute

MigrationFunc = Callable[[ModelData], ModelData]