Skip to main content

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

Download files

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

Source Distribution

neo4j-6.2.0.tar.gz (241.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-6.2.0-py3-none-any.whl (327.8 kB view details)

Uploaded Python 3

File details

Details for the file neo4j-6.2.0.tar.gz.

File metadata

  • Download URL: neo4j-6.2.0.tar.gz
  • Upload date:
  • Size: 241.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for neo4j-6.2.0.tar.gz
Algorithm Hash digest
SHA256 e1e246b65b572bd8ea97f9e0e721b7d40a5ce53e53d0007c29aef63e4f9124d9
MD5 c9c3ed4bf37ba30ecf855d7150b1cda7
BLAKE2b-256 cef4aaa4ac19adae4b01bc742b63afd2672a77e7351566f02721e713e4b863ee

See more details on using hashes here.

File details

Details for the file neo4j-6.2.0-py3-none-any.whl.

File metadata

  • Download URL: neo4j-6.2.0-py3-none-any.whl
  • Upload date:
  • Size: 327.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for neo4j-6.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b87abdd13a5cc2e3bd51026926c2f20ac38fa3febe98c340520dce19e97388d0
MD5 209099243eab8df70f9beaf1a6ccec0f
BLAKE2b-256 e6cf1c3795866cefaac6e648d4e98c373cafd97810f6e317c307371007ab4abb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

6.2.0

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page