{"library":"py2neo","title":"py2neo","description":"Py2neo is a client library and toolkit for working with Neo4j from Python applications. As of version 2021.2.4, it supports Neo4j 4.x and uses the Bolt protocol. Development has slowed; users are encouraged to migrate to the official neo4j driver for newer Neo4j versions.","language":"python","status":"maintenance","last_verified":"Fri May 01","install":{"commands":["pip install py2neo"],"cli":null},"imports":["from py2neo import Graph","from py2neo import Node","from py2neo import Relationship","from py2neo import NodeMatcher"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from py2neo import Graph, Node, Relationship\n\n# Connect to Neo4j (adjust URI/user/password)\ngraph = Graph(\"bolt://localhost:7687\", auth=(\"neo4j\", \"password\"))\n\n# Create a node\nalice = Node(\"Person\", name=\"Alice\")\ngraph.create(alice)\n\n# Create another node and relationship\nbob = Node(\"Person\", name=\"Bob\")\nknows = Relationship(alice, \"KNOWS\", bob)\ngraph.create(knows)\n\n# Query back\nresults = graph.run(\"MATCH (a:Person)-[:KNOWS]->(b:Person) RETURN a.name, b.name\").data()\nprint(results)","lang":"python","description":"Connect to Neo4j, create nodes and a relationship, then run a Cypher query.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}