Python Language Neo4j and Cypher using Py2Neo Importing and Authenticating

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

from py2neo import authenticate, Graph, Node, Relationship
authenticate("localhost:7474", "neo4j", "<pass>")
graph = Graph()

You have to make sure your Neo4j Database exists at localhost:7474 with the appropriate credentials.

the graph object is your interface to the neo4j instance in the rest of your python code. Rather thank making this a global variable, you should keep it in a class's __init__ method.



Got any Python Language Question?