bw_hestia_bridge.hestia_api.cycle_graph

Functions

get_cycle_graph(→ list[dict])

Get all the cycles that are in the connected graph of cycle_id.

Module Contents

bw_hestia_bridge.hestia_api.cycle_graph.get_cycle_graph(cycle_id: str, staging: bool | None = None) list[dict][source]

Get all the cycles that are in the connected graph of cycle_id.

Parameters:
  • cycle_id (str) – Hestia ID of the initial cycle.

  • staging (bool, optional (default: from configuration)) – Whether to use the staging API.

Returns:

List of cycles of the form

[
    {
        "from": {"@type": "Cycle", "@id": PARENT_CYCLE_ID},
        "to": {"@type": "Cycle", "@id": CHILD_CYCLE_ID},
        "via": {"@type": "Term", "@id": PRODUCT_TERM_ID}
    }, ...
]

Return type:

list[dict]

Raises:

ValueError – if cycle_id is not found