Neo4py is a better alternative to py2neo.


License
Apache-2.0
Install
pip install neo4py==0.1

Documentation

Neo4py

A proper documentation to neo4py will be available soon.

Introduction

Neo4py is an alternative to py2neo. I am trying my best to make it a perfect and better clone of the py2neo package.

How to run a query in neo4py

As it is a clone of py2neo so, I have added the similar functions like of py2neo so, that the users won't have the problem in migrating from py2neo to neo4py.

These are the steps you can use to execute a query in neo4py:

  1. Import the Graph class from the neo4py.

from neo4py import Graph

  1. Create a graph object and pass your URI, and connection details to the Graph constructor.

graph = Graph("connection_uri",("user","db_password"))

# Example code
graph = Graph("bolt://localhost:7687",("neo4j","12345678"))

You can find your connection uri and user details, when you'll start your database and open neo4j browser. Password is the password that you have set while creating the database.


  1. Now make a python dictionary, pass the data to it, and run and write the query by using built-in run method.

data = {
    "name" : "John Doe",
    "age": 21
}
node = graph.run("CREATE (p:Person {name:$name,age:$age})", **data)

Final Words

For any issues, please open an issue. I am open for suggesstions, contributions, and collaborations.😊


Special Thanks to Aaron Moffatt for letting me acquire the name, "neo4py"