lpgcast.schema_io¶
Load the governed schema a cast runs against.
Functions:¶
load_schema(path)
¶
Read a GraFlo Schema, or the schema block of a GraphManifest.
YAML or JSON; see :func:schema_from_mapping.
Raises:
| Type | Description |
|---|---|
TypeError
|
when the file does not hold a mapping. |
ValueError
|
when the mapping is neither a schema nor a manifest. |
Source code in lpgcast/schema_io.py
schema_from_mapping(data, source='schema')
¶
A GraFlo Schema from a mapping: a schema itself (core_schema at the
top) or a GraphManifest (schema or graph_schema).
Raises:
| Type | Description |
|---|---|
TypeError
|
when data is not a mapping. |
ValueError
|
when the mapping is neither a schema nor a manifest. |