ModelIndex Class

class modelindex.models.ModelIndex.ModelIndex(data: Optional[dict] = None, filepath: Optional[str] = None, _path_to_readme: Optional[str] = None, is_root: bool = False)[source]

ModelIndex is the root object for the whole model index.

Parameters
  • data (dict) – The root model index as a dictionary

  • filepath (str) – The path from which it was loaded

  • _path_to_readme (str) – The path to the readme file (if loaded from there)

  • is_root (bool) – If this is the root ModelIndex instance for the whole project

__init__(data: Optional[dict] = None, filepath: Optional[str] = None, _path_to_readme: Optional[str] = None, is_root: bool = False)[source]
Parameters
  • data (dict) – The root model index as a dictionary

  • filepath (str) – The path from which it was loaded

  • _path_to_readme (str) – The path to the readme file (if loaded from there)

  • is_root (bool) – If this is the root ModelIndex instance for the whole project

static from_dict(d: dict, filepath: Optional[str] = None, _path_to_readme: Optional[str] = None, is_root: bool = False)[source]

Construct a ModelIndex from a dictionary

Parameters
  • data (dict) – The root model index as a dictionary

  • filepath (str) – The path from which it was loaded

  • _path_to_readme (str) – Path to the README.md file if loaded from there

  • is_root (str) – If this is the root ModelIndex for the whole project

property models

Get the list of models in the ModelIndex.

property collections

Get the list of collections in the ModelIndex.