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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neo4j_driver-5.28.6.tar.gz (233.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neo4j_driver-5.28.6-py3-none-any.whl (314.1 kB view details)

Uploaded Python 3

File details

Details for the file neo4j_driver-5.28.6.tar.gz.

File metadata

  • Download URL: neo4j_driver-5.28.6.tar.gz
  • Upload date:
  • Size: 233.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for neo4j_driver-5.28.6.tar.gz
Algorithm Hash digest
SHA256 fae0b7649793d7f40d721971a996adb95427ea5abca03f5309d51ca7f8cb810f
MD5 d823d36db5b587978a3eb8b4668e6508
BLAKE2b-256 68edc7590020d47d16f41567af7dfc25dd214d9e6a87a51f9589cadb000e7142

See more details on using hashes here.

File details

Details for the file neo4j_driver-5.28.6-py3-none-any.whl.

File metadata

  • Download URL: neo4j_driver-5.28.6-py3-none-any.whl
  • Upload date:
  • Size: 314.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for neo4j_driver-5.28.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d1068dd475863680c1aadb822b3aded22e7abcad0bf0f63061721b56381e386d
MD5 b92b468c6727fdb8ce82f7a946a0e6e6
BLAKE2b-256 af3ece30c217fd297e19686e4a8e45e06ae5c211ec3288d6bb30d1453a3eece6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

5.28.6 This release

2 files

5.28.5

3 files

5.28.4

2 files

5.28.3

2 files

5.28.2

2 files

5.28.1

2 files

5.28.0

2 files

5.27.0

1 file

5.26.0

1 file

5.25.0

1 file

5.24.0

1 file

5.23.1

1 file

5.23.0

1 file

5.22.0

1 file

5.21.0

1 file

5.20.0

1 file

5.19.0

1 file

5.18.0

1 file

5.17.0

1 file

5.16.0

1 file

5.15.0

1 file

5.14.1

1 file

5.14.0

1 file

5.13.0

1 file

5.12.0

1 file

5.11.0

1 file

5.10.0

1 file

5.9.0

1 file

5.8.1

1 file

5.8.0

1 file

5.7.0

1 file

5.6.0

1 file

5.5.0

1 file

5.4.0

1 file

5.3.0

1 file

5.2.1

1 file

5.2.0

1 file

5.1.0

1 file

5.0.1

1 file

5.0.0

1 file

4.4.13

1 file

4.4.12

1 file

4.4.11

1 file

4.4.10

1 file

4.4.9

1 file

4.4.8

1 file

4.4.7

1 file

4.4.6

1 file

4.4.5

1 file

4.4.4

1 file

4.4.3

1 file

4.4.2

1 file

4.4.1

1 file

4.4.0

1 file

4.3.9

1 file

4.3.8

1 file

4.3.7

1 file

4.3.6

1 file

4.3.5

1 file

4.3.4

1 file

4.3.3

1 file

4.3.2

1 file

4.3.1

1 file

4.3.0

1 file

4.2.1

1 file

4.2.0

1 file

4.1.3

1 file

4.1.2

1 file

4.1.1

1 file

4.1.0

1 file

4.0.3

1 file

4.0.2

1 file

4.0.1

1 file

4.0.0

1 file

1.7.6

1 file

1.7.5

1 file

1.7.4

1 file

1.7.3

1 file

1.7.2

1 file

1.7.1

1 file

1.7.0

1 file

1.6.3

1 file

1.6.2

1 file

1.6.1

1 file

1.6.0

1 file

1.5.4

1 file

1.5.3

1 file

1.5.2

1 file

1.5.1

1 file

1.5.0

1 file

1.4.0

1 file

1.3.1

1 file

1.3.0

1 file

1.2.1

1 file

1.2.0

1 file

1.1.2

1 file

1.1.0

2 files

1.0.2

2 files

1.0.1

1 file

1.0.0

1 file

0.0.0

2 files

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