Files
revng-revng/python/revng/model
Giacomo Vercesi 152a624f47 revng.model: drop last version autodetection
revng.model.__init__ would dynamically import the latest version of
the model when imported, however this would break IDE hints as the
classes would not be properly detected. Instead we now manually
specify the last version in the __init__.py file.
2022-07-22 15:07:14 +02:00
..
2022-07-22 14:56:15 +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 = yaml.load(f, Loader=m.YamlLoader)

If you need to access a specific version of the model you can import it like so:

import yaml
from revng.model import v1

yaml.load(..., Loader=v1.YamlLoader)