Skip to main content

Neo4py is a better alternative to py2neo.

Project description

Neo4py

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.😊

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-atharnaveed-1.0.1b0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

neo4py_atharnaveed-1.0.1b0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file neo4py-atharnaveed-1.0.1b0.tar.gz.

File metadata

  • Download URL: neo4py-atharnaveed-1.0.1b0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for neo4py-atharnaveed-1.0.1b0.tar.gz
Algorithm Hash digest
SHA256 a7447e6e2c29e24971d3a7b964680efcc843a32bcbb989985ee336cb0666ab67
MD5 15740dd286987dfd96e5705ef47f1c1b
BLAKE2b-256 7092c89b3a1401605da87667a4755a726aeb7c0d4105ad1a3e6af4ccfff7a9e2

See more details on using hashes here.

File details

Details for the file neo4py_atharnaveed-1.0.1b0-py3-none-any.whl.

File metadata

File hashes

Hashes for neo4py_atharnaveed-1.0.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 74cbe224ebbc79790691882b9385e8284da1f0c5488e3002941497759ba2ee49
MD5 2880b95ed1b9adf7d26de99d7226e8ec
BLAKE2b-256 594975ac70c70126c2de1421e2c3df81f1a8eb4674d099632dd293ea51191c92

See more details on using hashes here.

Supported by

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