swh.graph.backend module

class swh.graph.backend.Backend(graph_path, config=None)[source]

Bases: object

count(ttype, direction, edges_fmt, src)[source]
simple_traversal(ttype, direction, edges_fmt, src)[source]
walk(direction, edges_fmt, algo, src, dst)[source]
random_walk(direction, edges_fmt, retries, src, dst)[source]
visit_paths(direction, edges_fmt, src)[source]
class swh.graph.backend.JavaStreamProxy(entry)[source]

Bases: object

A proxy class for the org.softwareheritage.graph.Entry Java class that takes care of the setup and teardown of the named-pipe FIFO communication between Python and Java.

Initialize JavaStreamProxy using:

proxy = JavaStreamProxy(swh_entry_class_instance)

Then you can call an Entry method and iterate on the FIFO results like this:

async for value in proxy.java_method(arg1, arg2):