randonneur.edges

Attributes

verb_dispatch

Functions

migrate_edges(→ List[dict])

For each edge in each node in graph, check each transformation in migrations. For

migrate_edges_with_stored_data(→ List[dict])

A simple wrapper to load from a randonneur_data.Registry with some basic sanity checks.

Module Contents

randonneur.edges.migrate_edges(graph: List[dict], migrations: dict, config: randonneur.config.MigrationConfig | None = None) List[dict][source]

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.

randonneur.edges.migrate_edges_with_stored_data(graph: List[dict], label: str, data_registry_path: pathlib.Path | None = None, config: randonneur.config.MigrationConfig | None = None) List[dict][source]

A simple wrapper to load from a randonneur_data.Registry with some basic sanity checks.

randonneur.edges.verb_dispatch[source]