Files
Giacomo Vercesi 90e8cce41e model: rework python mixin infrastructure
Rework the python mixin infrastructure for the model. Mixins are now
specified explicitly instead of using the `ast` module. The mixins are
loaded relative to the generated python file, this allows to have two
models: `revng.model` and `revng.project.model`. The latter is augmented
via mixins to have project-specific facilities such as `get_artifact`
and artifact accessors.
2026-04-10 11:45:12 +02:00
..
2025-05-05 16:02:40 +02:00
2025-07-18 09:30:55 +02:00

rev.ng model classes

By default, importing the top level package will expose the classes for the latest version of the model.

Example: deserializing a model

import yaml
from revng import model as m

with open("/path/to/model.yaml") as f:
    model = m.Binary.deserialize(f)

It is not possible to import a model with a schema version other than the latest. In order to load older models, you first need to migrate them, either using the revng.model.migrations Python module or using the revng model migrate CLI command.