Skip to main content

Neo4py is a better alternative to py2neo.

Project description

Neo4py

A proper documentation to neo4py is available here.

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. First install neo4j using either pip or uv.
pip install neo4j

# or you can use uv for this

uv pip install neo4j

  1. Import the Graph class from the neo4py.

from neo4py.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"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neo4py-1.1.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neo4py-1.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file neo4py-1.1.0.tar.gz.

File metadata

  • Download URL: neo4py-1.1.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for neo4py-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8addcb4a16e433a58ed12260b2b9d50d05caff54cb9b5c02cb1f619d89b6e6b8
MD5 ced2f10988d4c5bab3e23aaeab5fa47f
BLAKE2b-256 4b90bd4b90677dc2a76e3e18a3123b8d10479da2227c1601e94624fcba8e733e

See more details on using hashes here.

File details

Details for the file neo4py-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: neo4py-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for neo4py-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9fa6a8a4677636db3c0c550cbaed7ee1a48db050ef1113700d1e11d0d54d087
MD5 99adf169de17529b4b91fdc8901d3850
BLAKE2b-256 87429da674107ad21f43ce1221915b50dd712014cacbb9429c029b77d8cb79e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page