Neo4j Bolt driver for Python

neo4j, graph, database, binary-protocol, cypher, database-driver, driver, graph-database, protocol, python, python3, query-language
pip install neo4j==5.15.0


Neo4j Bolt Driver for Python

This repository contains the official Neo4j driver for Python.

Starting with 5.0, the Neo4j Drivers will be moving to a monthly release cadence. A minor version will be released on the last Friday of each month so as to maintain versioning consistency with the core product (Neo4j DBMS) which has also moved to a monthly cadence.

As a policy, patch versions will not be released except on rare occasions. Bug fixes and updates will go into the latest minor version and users should upgrade to that. Driver upgrades within a major version will never contain breaking API changes.

See also:

  • Python 3.12 supported.
  • Python 3.11 supported.
  • Python 3.10 supported.
  • Python 3.9 supported.
  • Python 3.8 supported.
  • Python 3.7 supported.


To install the latest stable version, use:

pip install neo4j


neo4j-driver is the old name for this package. It is now deprecated and and will receive no further updates starting with 6.0.0. Make sure to install neo4j as shown above.

Quick Example

from neo4j import GraphDatabase, RoutingControl

URI = "neo4j://localhost:7687"
AUTH = ("neo4j", "password")

def add_friend(driver, name, friend_name):
        "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 = $name "
        "RETURN ORDER BY",
        name=name, database_="neo4j", routing_=RoutingControl.READ,
    for record in records:

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