shell
pip install py2neo
python
import py2neo
python
from py2neo import Graph
graph = Graph("http://localhost:7474/db/data/", username="neo4j", password="password")
python
person_node = Node("Person", name="John")
graph.create(person_node)
person_node_two = Node("Person", name="Jane")
graph.create(person_node_two)
knows_relationship = Relationship(person_node, "KNOWS", person_node_two)
graph.create(knows_relationship)
python
from py2neo import NodeMatcher
matcher = NodeMatcher(graph)
person_nodes = matcher.match("Person")
for person_node in person_nodes:
print(person_node)