Neo4j Bolt Driver for Python
This repository contains the official Neo4j driver for Python.
Driver upgrades within a major version will never contain breaking API changes.
For version compatibility with Neo4j server, please refer to: https://neo4j.com/developer/kb/neo4j-supported-versions/
Python 3.15 supported.
Python 3.14 supported.
Python 3.13 supported.
Python 3.12 supported.
Python 3.11 supported.
Python 3.10 supported.
Installation
To install the latest stable version, use:
pip install neo4j
Alternative Installation for Better Performance
You may want to have a look at the available Rust extensions for this driver for better performance. The Rust extensions are not installed by default. For more information, see neo4j-rust-ext.
Quick Example
from neo4j import GraphDatabase, RoutingControl
URI = "neo4j://localhost:7687"
AUTH = ("neo4j", "password")
def add_friend(driver, name, friend_name):
driver.execute_query(
"MERGE (a:Person {name: $name}) "
"MERGE (friend:Person {name: $friend_name}) "
"MERGE (a)-[:KNOWS]->(friend)",
name=name, friend_name=friend_name, database_="neo4j",
)
def print_friends(driver, name):
records, _, _ = driver.execute_query(
"MATCH (a:Person)-[:KNOWS]->(friend) WHERE a.name = $name "
"RETURN friend.name ORDER BY friend.name",
name=name, database_="neo4j", routing_=RoutingControl.READ,
)
for record in records:
print(record["friend.name"])
with GraphDatabase.driver(URI, auth=AUTH) as driver:
add_friend(driver, "Arthur", "Guinevere")
add_friend(driver, "Arthur", "Lancelot")
add_friend(driver, "Arthur", "Merlin")
print_friends(driver, "Arthur")
Further Information
The Neo4j Operations Manual (docs on how to run a Neo4j server)
The Neo4j Python Driver Manual (good introduction to this driver)
Python Driver API Documentation (full API documentation for this driver)
Neo4j Cypher Cheat Sheet (summary of Cypher syntax - Neo4j’s graph query language)
Example Project (small web application using this driver)
GraphAcademy (interactive, free online trainings for Neo4j)
Driver Wiki (includes change logs)
Metadata
Release files for neo4j 6.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| neo4j-6.4.1.tar.gz | 287.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| neo4j-6.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 678.6 kB
Release files / neo4j-6.4.1.tar.gz
| Download URL | neo4j-6.4.1.tar.gz |
|---|---|
| Size | 287.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fac99b7cb9679b93ef97dc23f22a3f0e7c3feb2db223eddfd2521f27005cfeaf
|
|
BLAKE2b-256 checksum How to use checksums |
d1d1bc40a291c60b06738ce92d5f0259d348eee1f07ba10d569a881c848c8afe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0rc2
|
Release files / neo4j-6.4.1-py3-none-any.whl
| Download URL | neo4j-6.4.1-py3-none-any.whl |
|---|---|
| Size | 390.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f56a281c74355522fc2642df8919bec450115431531b8f3f6fe1cc17acb57a27
|
|
BLAKE2b-256 checksum How to use checksums |
07693036bdcacfba561c6ef4b00fe72529e0a1b6241a6b2de82572a0940a276b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0rc2
|
Security for neo4j 6.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.