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.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)
Release files for neo4j 6.3.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 | |
|---|---|---|---|
| neo4j-6.3.1.tar.gz | 242.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| neo4j-6.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 574.3 kB
Release files / neo4j-6.3.1.tar.gz
| Download URL | neo4j-6.3.1.tar.gz |
|---|---|
| Size | 242.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e75530ca0691d69916c56acdb7401df4ee9e1d5084cfcfb3ede796db38667dcd
|
|
BLAKE2b-256 checksum How to use checksums |
59467a562799679d0c9bd3f12d28b43591eb953efc975e1241536733c5d8bcd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / neo4j-6.3.1-py3-none-any.whl
| Download URL | neo4j-6.3.1-py3-none-any.whl |
|---|---|
| Size | 331.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1b702d356f88885c27bdcf7dcd56af76423dbff4e26064e5bf5dbf47af53044
|
|
BLAKE2b-256 checksum How to use checksums |
08a5e33f76f4eb7e72c350e65802151884048325f889ab5d156ce4b6d9bde959
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|