graflo.cli.io¶
Loading and writing manifests, shared by the verbs that do both.
Extracted from graflo.cli.commit once check and merge needed the
same two lines. The load is not merely FileHandle.load -- it runs
finish_init(), which is where GraFlo validates cross-block references, so a
verb that skips it operates on a manifest that has not been checked.
Attributes¶
DECLARED_KEYS = ('edge.directed', 'vertex.identity')
module-attribute
¶
__all__ = ['DECLARED_KEYS', 'dump_manifest', 'load_manifest', 'load_mapping', 'manifest_to_dict']
module-attribute
¶
Classes¶
Functions:¶
dump_manifest(manifest, path, *, declare=())
¶
Write manifest to path, announcing it. None writes nothing.
Source code in graflo/cli/io.py
load_manifest(path)
¶
Read and fully initialise the manifest at path.
load_mapping(path)
¶
Read a YAML/JSON document that must be a mapping.
Raises:
| Type | Description |
|---|---|
ClickException
|
the document is a list or a scalar. Pydantic's own error for that names a model the user never wrote. |
Source code in graflo/cli/io.py
manifest_to_dict(manifest, *, declare=())
¶
A compact dump of manifest, with declare keys stated explicitly.