****************************
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.11 supported.
+ Python 3.10 supported.
+ Python 3.9 supported.
+ Python 3.8 supported.
+ Python 3.7 supported.
Installation
============
To install the latest stable version, use:
.. code:: bash
pip install neo4j
.. TODO: 7.0 - remove this note
.. note::
``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
=============
.. code-block:: python
from neo4j import GraphDatabase
driver = GraphDatabase.driver("neo4j://localhost:7687",
auth=("neo4j", "password"))
def add_friend(tx, name, friend_name):
tx.run("MERGE (a:Person {name: $name}) "
"MERGE (a)-[:KNOWS]->(friend:Person {name: $friend_name})",
name=name, friend_name=friend_name)
def print_friends(tx, name):
query = ("MATCH (a:Person)-[:KNOWS]->(friend) WHERE a.name = $name "
"RETURN friend.name ORDER BY friend.name")
for record in tx.run(query, name=name):
print(record["friend.name"])
with driver.session(database="neo4j") as session:
session.execute_write(add_friend, "Arthur", "Guinevere")
session.execute_write(add_friend, "Arthur", "Lancelot")
session.execute_write(add_friend, "Arthur", "Merlin")
session.execute_read(print_friends, "Arthur")
driver.close()
Connection Settings Breaking Change (4.x)
=========================================
+ The driver’s default configuration for encrypted is now false
(meaning that driver will only attempt plain text connections by default).
+ Connections to encrypted services (such as Neo4j Aura) should now explicitly
be set to encrypted.
+ When encryption is explicitly enabled, the default trust mode is to trust the
CAs that are trusted by operating system and use hostname verification.
+ This means that encrypted connections to servers holding self-signed
certificates will now fail on certificate verification by default.
+ Using the new ``neo4j+ssc`` scheme will allow to connect to servers holding self-signed certificates and not use hostname verification.
+ The ``neo4j://`` scheme replaces ``bolt+routing://`` and can be used for both clustered and single-instance configurations with Neo4j 4.0.
See, https://neo4j.com/docs/migration-guide/4.0/upgrade-driver/#upgrade-driver-breakingchanges
See, https://neo4j.com/docs/driver-manual/current/client-applications/#driver-connection-uris for changes in default security settings between 3.x and 4.x
Connecting with Python Driver 4.x to Neo4j 3.5 (EOL)
----------------------------------------------------
Using the Python Driver 4.x and connecting to Neo4j 3.5 with default connection settings for Neo4j 3.5.
.. code-block:: python
# the preferred form
driver = GraphDatabase.driver("neo4j+ssc://localhost:7687", auth=("neo4j", "password"))
# is equivalent to
driver = GraphDatabase.driver("neo4j://localhost:7687", auth=("neo4j", "password"), encrypted=True, trust=False)
Connecting with Python Driver 1.7 (EOL) to Neo4j 4.x
----------------------------------------------------
Using the Python Driver 1.7 and connecting to Neo4j 4.x with default connection settings for Neo4j 4.x.
.. code-block:: python
driver = GraphDatabase.driver("neo4j://localhost:7687", auth=("neo4j", "password"), encrypted=False)
Other Information
=================
* `The Neo4j Operations Manual`_
* `The Neo4j Drivers Manual`_
* `Python Driver API Documentation`_
* `Neo4j Cypher Refcard`_
* `Example Project`_
* `Driver Wiki`_ (includes change logs)
* `Neo4j 4.0 Migration Guide`_
.. _`The Neo4j Operations Manual`: https://neo4j.com/docs/operations-manual/current/
.. _`The Neo4j Drivers Manual`: https://neo4j.com/docs/driver-manual/current/
.. _`Python Driver API Documentation`: https://neo4j.com/docs/api/python-driver/current/
.. _`Neo4j Cypher Refcard`: https://neo4j.com/docs/cypher-refcard/current/
.. _`Example Project`: https://github.com/neo4j-examples/movies-python-bolt
.. _`Driver Wiki`: https://github.com/neo4j/neo4j-python-driver/wiki
.. _`Neo4j 4.0 Migration Guide`: https://neo4j.com/docs/migration-guide/4.0/
Raw data
{
"_id": null,
"home_page": "",
"name": "neo4j",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "neo4j,graph,database",
"author": "",
"author_email": "\"Neo4j, Inc.\" <drivers@neo4j.com>",
"download_url": "https://files.pythonhosted.org/packages/e9/b7/faa4628ea379f9e43772ca4448356a35e58ce44306a91117f2892487e187/neo4j-5.9.0.tar.gz",
"platform": null,
"description": "****************************\nNeo4j Bolt Driver for Python\n****************************\n\nThis repository contains the official Neo4j driver for Python.\n\nStarting with 5.0, the Neo4j Drivers will be moving to a monthly release\ncadence. A minor version will be released on the last Friday of each month so\nas to maintain versioning consistency with the core product (Neo4j DBMS) which\nhas also moved to a monthly cadence.\n\nAs a policy, patch versions will not be released except on rare occasions. Bug\nfixes and updates will go into the latest minor version and users should\nupgrade to that. Driver upgrades within a major version will never contain\nbreaking API changes.\n\nSee also: https://neo4j.com/developer/kb/neo4j-supported-versions/\n\n+ Python 3.11 supported.\n+ Python 3.10 supported.\n+ Python 3.9 supported.\n+ Python 3.8 supported.\n+ Python 3.7 supported.\n\n\nInstallation\n============\n\nTo install the latest stable version, use:\n\n.. code:: bash\n\n pip install neo4j\n\n\n.. TODO: 7.0 - remove this note\n\n.. note::\n\n ``neo4j-driver`` is the old name for this package. It is now deprecated and\n and will receive no further updates starting with 6.0.0. Make sure to\n install ``neo4j`` as shown above.\n\n\nQuick Example\n=============\n\n.. code-block:: python\n\n from neo4j import GraphDatabase\n\n driver = GraphDatabase.driver(\"neo4j://localhost:7687\",\n auth=(\"neo4j\", \"password\"))\n\n def add_friend(tx, name, friend_name):\n tx.run(\"MERGE (a:Person {name: $name}) \"\n \"MERGE (a)-[:KNOWS]->(friend:Person {name: $friend_name})\",\n name=name, friend_name=friend_name)\n\n def print_friends(tx, name):\n query = (\"MATCH (a:Person)-[:KNOWS]->(friend) WHERE a.name = $name \"\n \"RETURN friend.name ORDER BY friend.name\")\n for record in tx.run(query, name=name):\n print(record[\"friend.name\"])\n\n with driver.session(database=\"neo4j\") as session:\n session.execute_write(add_friend, \"Arthur\", \"Guinevere\")\n session.execute_write(add_friend, \"Arthur\", \"Lancelot\")\n session.execute_write(add_friend, \"Arthur\", \"Merlin\")\n session.execute_read(print_friends, \"Arthur\")\n\n driver.close()\n\n\nConnection Settings Breaking Change (4.x)\n=========================================\n\n+ The driver\u2019s default configuration for encrypted is now false\n (meaning that driver will only attempt plain text connections by default).\n\n+ Connections to encrypted services (such as Neo4j Aura) should now explicitly\n be set to encrypted.\n\n+ When encryption is explicitly enabled, the default trust mode is to trust the\n CAs that are trusted by operating system and use hostname verification.\n\n+ This means that encrypted connections to servers holding self-signed\n certificates will now fail on certificate verification by default.\n\n+ Using the new ``neo4j+ssc`` scheme will allow to connect to servers holding self-signed certificates and not use hostname verification.\n\n+ The ``neo4j://`` scheme replaces ``bolt+routing://`` and can be used for both clustered and single-instance configurations with Neo4j 4.0.\n\n\n\nSee, https://neo4j.com/docs/migration-guide/4.0/upgrade-driver/#upgrade-driver-breakingchanges\n\n\nSee, https://neo4j.com/docs/driver-manual/current/client-applications/#driver-connection-uris for changes in default security settings between 3.x and 4.x\n\n\nConnecting with Python Driver 4.x to Neo4j 3.5 (EOL)\n----------------------------------------------------\n\nUsing the Python Driver 4.x and connecting to Neo4j 3.5 with default connection settings for Neo4j 3.5.\n\n.. code-block:: python\n\n # the preferred form\n\n driver = GraphDatabase.driver(\"neo4j+ssc://localhost:7687\", auth=(\"neo4j\", \"password\"))\n\n # is equivalent to\n\n driver = GraphDatabase.driver(\"neo4j://localhost:7687\", auth=(\"neo4j\", \"password\"), encrypted=True, trust=False)\n\n\nConnecting with Python Driver 1.7 (EOL) to Neo4j 4.x\n----------------------------------------------------\n\nUsing the Python Driver 1.7 and connecting to Neo4j 4.x with default connection settings for Neo4j 4.x.\n\n.. code-block:: python\n\n driver = GraphDatabase.driver(\"neo4j://localhost:7687\", auth=(\"neo4j\", \"password\"), encrypted=False)\n\n\nOther Information\n=================\n\n* `The Neo4j Operations Manual`_\n* `The Neo4j Drivers Manual`_\n* `Python Driver API Documentation`_\n* `Neo4j Cypher Refcard`_\n* `Example Project`_\n* `Driver Wiki`_ (includes change logs)\n* `Neo4j 4.0 Migration Guide`_\n\n.. _`The Neo4j Operations Manual`: https://neo4j.com/docs/operations-manual/current/\n.. _`The Neo4j Drivers Manual`: https://neo4j.com/docs/driver-manual/current/\n.. _`Python Driver API Documentation`: https://neo4j.com/docs/api/python-driver/current/\n.. _`Neo4j Cypher Refcard`: https://neo4j.com/docs/cypher-refcard/current/\n.. _`Example Project`: https://github.com/neo4j-examples/movies-python-bolt\n.. _`Driver Wiki`: https://github.com/neo4j/neo4j-python-driver/wiki\n.. _`Neo4j 4.0 Migration Guide`: https://neo4j.com/docs/migration-guide/4.0/\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "Neo4j Bolt driver for Python",
"version": "5.9.0",
"project_urls": {
"Homepage": "https://github.com/neo4j/neo4j-python-driver"
},
"split_keywords": [
"neo4j",
"graph",
"database"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e9b7faa4628ea379f9e43772ca4448356a35e58ce44306a91117f2892487e187",
"md5": "2fcbb330066736d5b98c6a2d1326e58e",
"sha256": "b0abc0065f616bfd8230a48b1f6c91f9aacd7e2aea76d72d09a745ae169cf4da"
},
"downloads": -1,
"filename": "neo4j-5.9.0.tar.gz",
"has_sig": false,
"md5_digest": "2fcbb330066736d5b98c6a2d1326e58e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 188455,
"upload_time": "2023-05-26T10:30:16",
"upload_time_iso_8601": "2023-05-26T10:30:16.217475Z",
"url": "https://files.pythonhosted.org/packages/e9/b7/faa4628ea379f9e43772ca4448356a35e58ce44306a91117f2892487e187/neo4j-5.9.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-26 10:30:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "neo4j",
"github_project": "neo4j-python-driver",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pytz",
"specs": []
}
],
"tox": true,
"lcname": "neo4j"
}