randonneur.edges ================ .. py:module:: randonneur.edges Attributes ---------- .. autoapisummary:: randonneur.edges.verb_dispatch Functions --------- .. autoapisummary:: randonneur.edges.migrate_edges randonneur.edges.migrate_edges_with_stored_data Module Contents --------------- .. py:function:: migrate_edges(graph: List[dict], migrations: dict, config: Optional[randonneur.config.MigrationConfig] = None) -> List[dict] For each edge in each node in ``graph``, check each transformation in ``migrations``. For each transformation for which there is a match, make the given changes to the edge. Here is an example: ```python migrate_edges( graph=[{"edges": [{"name": "foo"}]}], migrations={"update": [{"source": {"name": "foo"}, "target": {"location": "bar"}}]}, ) >>> [{"edges": [{"name": "foo", "location": "bar"}]}] ``` The changes can be customized with a `MigrationConfig` object. See the `MigrationConfig` docs for information on its input arguments. *Changes graph in place*, and returns `graph` with altered content. .. py:function:: migrate_edges_with_stored_data(graph: List[dict], label: str, data_registry_path: Optional[pathlib.Path] = None, config: Optional[randonneur.config.MigrationConfig] = None) -> List[dict] A simple wrapper to load from a `randonneur_data.Registry` with some basic sanity checks. .. py:data:: verb_dispatch