Skip to main content

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: https://neo4j.com/developer/kb/neo4j-supported-versions/

  • Python 3.13 supported (since driver version 5.26.0).

  • Python 3.12 supported (since driver version 5.14.0).

  • Python 3.11 supported (since driver version 5.3.0).

  • Python 3.10 supported.

  • Python 3.9 supported.

  • Python 3.8 supported.

  • Python 3.7 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

Metadata

Release files for neo4j 5.28.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neo4j 5.28.5
File Size Uploaded Provenance Actions
neo4j-5.28.5.tar.gz 232.8 kB Without provenance Details for neo4j-5.28.5.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for neo4j 5.28.5
File Interpreter ABI Platform Actions
neo4j-5.28.5.0-py3-none-any.whl Python 3 none any Details for neo4j-5.28.5.0-py3-none-any.whl
neo4j-5.28.5-py3-none-any.whl Python 3 none any Details for neo4j-5.28.5-py3-none-any.whl

Total release size: 860.7 kB

Release files / neo4j-5.28.5.tar.gz

Download URL neo4j-5.28.5.tar.gz
Size 232.8 kB
Tags Source
SHA-256 checksum
How to use checksums
22c17254dc99cded006ff8d1904fe4c8a09d2b67f4e02709bfeca95786b1b58d
BLAKE2b-256 checksum
How to use checksums
a9fc56d23ba3eed18ad3cfece6fadc52a2386d16627e8d96554f43b14984e857
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / neo4j-5.28.5.0-py3-none-any.whl

Download URL neo4j-5.28.5.0-py3-none-any.whl
Size 314.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8ab75a72d54f2aceea35a22d1cd39203f754777c6ec8ccb3d9e6d4d8b8bdd4e
BLAKE2b-256 checksum
How to use checksums
0c9becd432ccda4c4a1015e46a19645922cad7304cf37012982b22b2777a29c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / neo4j-5.28.5-py3-none-any.whl

Download URL neo4j-5.28.5-py3-none-any.whl
Size 313.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5a919bb7be2dd0ccb72acd52724964b73f1bb5f5c753a031af84dbbe170fbf3
BLAKE2b-256 checksum
How to use checksums
aafc4e379b0bdecf3a22ec4581a594349f88546ee0a6e0d3cbd8941013e1411a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for neo4j 5.28.5

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.

Release history Release notifications | RSS feed

This release

5.28.5 This release

3 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page