ragraph.io.canopy
#
Canopy by Ratio CASE format support.
Module Contents#
Functions#
|
|
|
Get the graph(s) from a Canopy data file. |
|
Save graph as a Canopy dataset. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Attributes#
- ragraph.io.canopy.SCHEMA_PAT#
- ragraph.io.canopy._match_schema(pat: str) Optional[str] #
- ragraph.io.canopy.from_canopy(path: Union[str, pathlib.Path]) List[ragraph.graph.Graph] #
Get the graph(s) from a Canopy data file.
- Parameters:
path – Path of the file to load.
- Returns:
Graph objects contained in Canopy data formats being either a graph, tab, session, or workspace export of Canopy.
- Raises:
InconsistencyError if graph is inconsistent. –
- ragraph.io.canopy.to_canopy(graph: ragraph.graph.Graph, path: Optional[Union[pathlib.Path, str]] = None, fmt: str = 'session') Optional[str] #
Save graph as a Canopy dataset.
- Parameters:
graph – Graph to save.
path – Path to write to.
fmt – One of ‘session’ or ‘graph’.
- Returns:
JSON encoded string if no path was provided to write to.
- ragraph.io.canopy._encode_metadata(obj: ragraph.generic.Metadata, schema: bool = True) Dict[str, Any] #
- ragraph.io.canopy._encode_node(obj: ragraph.graph.Node, schema: bool = True) Dict[str, Any] #
- ragraph.io.canopy._encode_edge(obj: ragraph.graph.Edge, schema: bool = True) Dict[str, Any] #
- ragraph.io.canopy._encode_graph(obj: ragraph.graph.Graph, schema: bool = True) Dict[str, Any] #
- ragraph.io.canopy._encode_session(graph: ragraph.graph.Graph, schema: bool = True) Dict[str, Any] #
- ragraph.io.canopy._decode_node(data: Dict[str, Any]) ragraph.graph.Node #
- ragraph.io.canopy._decode_hierarchy(data: Dict[str, Any], graph: ragraph.graph.Graph) None #
- ragraph.io.canopy._decode_edge(data: Dict[str, Any], graph: ragraph.graph.Graph) ragraph.graph.Edge #
- ragraph.io.canopy._decode_graph(data: Dict[str, Any]) ragraph.graph.Graph #
- ragraph.io.canopy._decode_tab(data: Dict[str, Any]) Generator[ragraph.graph.Graph, None, None] #
- ragraph.io.canopy._decode_session(data: Dict[str, Any]) Generator[ragraph.graph.Graph, None, None] #
- ragraph.io.canopy._decode_workspace(data: Dict[str, Any]) Generator[ragraph.graph.Graph, None, None] #