swh.graph.graph module

swh.graph.graph.call_async_gen(generator, *args, **kwargs)[source]
class swh.graph.graph.Neighbors(graph, iterator, length_func)[source]

Bases: object

Neighbor iterator with custom O(1) length method

class swh.graph.graph.GraphNode(graph, node_id)[source]

Bases: object

Node in the SWH graph

children()[source]
parents()[source]
simple_traversal(ttype, direction='forward', edges='*')[source]
leaves(*args, **kwargs)[source]
visit_nodes(*args, **kwargs)[source]
visit_edges(direction='forward', edges='*')[source]
visit_paths(direction='forward', edges='*')[source]
walk(dst, direction='forward', edges='*', traversal='dfs')[source]
count_leaves(*, ttype='leaves', direction='forward', edges='*')
count_neighbors(*, ttype='neighbors', direction='forward', edges='*')
count_visit_nodes(*, ttype='visit_nodes', direction='forward', edges='*')
property pid
property kind
dot_fragment()[source]
class swh.graph.graph.Graph(backend, node2pid, pid2node)[source]

Bases: object

stats()[source]
property path
iter_prefix(prefix)[source]
iter_type(pid_type)[source]
swh.graph.graph.load(graph_path)[source]