trustgraph/scripts/graph-show

46 lines
771 B
Text
Raw Normal View History

2024-07-10 23:20:06 +01:00
#!/usr/bin/env python3
2024-07-12 15:06:51 +01:00
"""
Connects to the trustgraph graph hosts and dumps all graph edges.
"""
import argparse
import time
2024-07-10 23:20:06 +01:00
from trustgraph.trustgraph import TrustGraph
2024-07-12 15:06:51 +01:00
def show_graph(graph_hosts):
t = TrustGraph(hosts=graph_hosts)
rows = t.get_all(limit=100_000_000)
for s, p, o in rows:
print(s, p, o)
def main():
parser = argparse.ArgumentParser(
prog='graph-show',
description=__doc__,
)
parser.add_argument(
'-g', '--graph-hosts',
default="localhost",
help=f'Graph host (default: localhost)',
)
args = parser.parse_args()
try:
show_graph(graph_hosts=args.graph_hosts.split(","))
except Exception as e:
print("Exception:", e, flush=True)
2024-07-10 23:20:06 +01:00
2024-07-12 15:06:51 +01:00
main()
2024-07-10 23:20:06 +01:00