I started to learn Neo4J some days ago for a project. I first launched some Cypher query in my imported Graph (~ 6 million nodes) using Neo4J Browser (I'm working locally with bolt) to test my skills, and the software gives me back the nodes and edges graphically.
Now, I need to launch Cypher queries from Python. I have never used python before so I'm using the official documentation to do this job. I'm using neo4j module (from Documentation) to test it and I ran some basic queries successfully.
The problem is: I need to "print" the graph obtained from my queries as Neo4J Browser does, but using Python. I searched on google and I have found different results, sometimes they talk about using JS to draw the graph.
As said, I'm using a single Python file to work and I'm very unexperienced with this language. Could you suggest me a good library to draw nodes and edges resulted from my query?
Right now this is my code:
def test(self):
with self.driver.session(database=self.database) as session:
session.read_transaction(self._print_nodes)
@staticmethod
def _print_nodes(tx):
result=tx.run("MATCH (n:cell) RETURN n.name, n.id LIMIT 10")
for record in result:
print("ID: ",record["n.id"],"| Name: ",record["n.name"])
And this is the result in my console as expected:
But I want something like this:
In this case, I changed the query just to print some nodes, but I hope you got what I mean. I'm going to run some queries like N-[E]->M and I need to see the Node N connected through the edge E to the node M in my GUI. If, between the nodes, more nodes are present, I need to print the whole subgraph which connects N to M, with every Node found in the middle.

