Skip to content

Commit 8d9833a

Browse files
committed
Merge branch '5.0' into testkit-integration-test-migration
2 parents 5d13f30 + c71b938 commit 8d9833a

36 files changed

+2581
-1700
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.0.1
5+
rev: v4.1.0
66
hooks:
77
- id: check-case-conflict
88
- id: check-docstring-first
@@ -20,11 +20,15 @@ repos:
2020
- id: trailing-whitespace
2121
args: [ --markdown-linebreak-ext=md ]
2222
- repo: https://github.com/pycqa/isort
23-
rev: 5.10.0
23+
rev: 5.10.1
2424
hooks:
2525
- id: isort
26-
- repo: local
27-
hooks:
26+
- repo: https://github.com/sphinx-contrib/sphinx-lint
27+
rev: e83a1a42a73284d301c05baaffc176042ffbcf82
28+
hooks:
29+
- id: sphinx-lint
30+
- repo: local
31+
hooks:
2832
- id: unasync
2933
name: unasync
3034
entry: bin/make-unasync

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Neo4j Bolt Driver for Python
33
****************************
44

55
This repository contains the official Neo4j driver for Python.
6-
Each driver release (from 4.0 upwards) is built specifically to work with a corresponding Neo4j release, i.e. that with the same `major.minor` version number.
6+
Each driver release (from 4.0 upwards) is built specifically to work with a corresponding Neo4j release, i.e. that with the same ``major.minor`` version number.
77
These drivers will also be compatible with the previous Neo4j release, although new server features will not be available.
88

99
+ Python 3.10 supported.
@@ -63,9 +63,9 @@ Connection Settings Breaking Change
6363

6464
+ This means that encrypted connections to servers holding self-signed certificates will now fail on certificate verification by default.
6565

66-
+ Using the new `neo4j+ssc` scheme will allow to connect to servers holding self-signed certificates and not use hostname verification.
66+
+ Using the new ``neo4j+ssc`` scheme will allow to connect to servers holding self-signed certificates and not use hostname verification.
6767

68-
+ The `neo4j://` scheme replaces `bolt+routing://` and can be used for both clustered and single-instance configurations with Neo4j 4.0.
68+
+ The ``neo4j://`` scheme replaces ``bolt+routing://`` and can be used for both clustered and single-instance configurations with Neo4j 4.0.
6969

7070

7171

docs/source/api.rst

Lines changed: 30 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GraphDatabase
1111
Driver Construction
1212
===================
1313

14-
The :class:`neo4j.Driver` construction is done via a `classmethod` on the :class:`neo4j.GraphDatabase` class.
14+
The :class:`neo4j.Driver` construction is done via a ``classmethod`` on the :class:`neo4j.GraphDatabase` class.
1515

1616
.. autoclass:: neo4j.GraphDatabase
1717
:members: driver
@@ -29,7 +29,7 @@ Driver creation example:
2929
driver.close() # close the driver object
3030
3131
32-
For basic authentication, `auth` can be a simple tuple, for example:
32+
For basic authentication, ``auth`` can be a simple tuple, for example:
3333

3434
.. code-block:: python
3535
@@ -56,7 +56,7 @@ Other authentication methods are described under :ref:`auth-ref`.
5656
URI
5757
===
5858

59-
On construction, the `scheme` of the URI determines the type of :class:`neo4j.Driver` object created.
59+
On construction, the ``scheme`` of the URI determines the type of :class:`neo4j.Driver` object created.
6060

6161
Available valid URIs:
6262

@@ -568,7 +568,7 @@ Name of the database to query.
568568
Name of the user to impersonate.
569569
This means that all actions in the session will be executed in the security
570570
context of the impersonated user. For this, the user for which the
571-
:class:``Driver`` has been created needs to have the appropriate permissions.
571+
:class:`Driver` has been created needs to have the appropriate permissions.
572572

573573
:Type: ``str``, None
574574

@@ -604,7 +604,7 @@ The default access mode.
604604

605605
A session can be given a default access mode on construction.
606606

607-
This applies only in clustered environments and determines whether transactions carried out within that session should be routed to a `read` or `write` server by default.
607+
This applies only in clustered environments and determines whether transactions carried out within that session should be routed to a ``read`` or ``write`` server by default.
608608

609609
Transactions (see :ref:`managed-transactions-ref`) within a session can override the access mode passed to that session on construction.
610610

@@ -689,7 +689,7 @@ Explicit transactions support multiple statements and must be created with an ex
689689

690690
This creates a new :class:`neo4j.Transaction` object that can be used to run Cypher.
691691

692-
It also gives applications the ability to directly control `commit` and `rollback` activity.
692+
It also gives applications the ability to directly control ``commit`` and ``rollback`` activity.
693693

694694
.. autoclass:: neo4j.Transaction()
695695

@@ -804,14 +804,14 @@ A :class:`neo4j.Result` is attached to an active connection, through a :class:`n
804804

805805
.. automethod:: graph
806806

807-
**This is experimental.** (See :ref:`filter-warnings-ref`)
808-
809807
.. automethod:: value
810808

811809
.. automethod:: values
812810

813811
.. automethod:: data
814812

813+
.. automethod:: to_df
814+
815815
.. automethod:: closed
816816

817817
See https://neo4j.com/docs/python-manual/current/cypher-workflow/#python-driver-type-mapping for more about type mapping.
@@ -853,9 +853,9 @@ Record
853853
.. describe:: record == other
854854

855855
Compare a record for equality with another value.
856-
The `other` value may be any `Sequence` or `Mapping`, or both.
857-
If comparing with a `Sequence`, the values are compared in order.
858-
If comparing with a `Mapping`, the values are compared based on their keys.
856+
The ``other`` value may be any ``Sequence`` or``Mapping`` or both.
857+
If comparing with a``Sequence`` the values are compared in order.
858+
If comparing with a``Mapping`` the values are compared based on their keys.
859859
If comparing with a value that exhibits both traits, both comparisons must be true for the values to be considered equal.
860860

861861
.. describe:: record != other
@@ -927,7 +927,7 @@ Core Data Types
927927

928928
Cypher supports a set of core data types that all map to built-in types in Python.
929929

930-
These include the common `Boolean`, `Integer`, `Float` and `String` types as well as `List` and `Map` that can hold heterogenous collections of any other type.
930+
These include the common``Boolean`` ``Integer`` ``Float`` and ``String`` types as well as ``List`` and ``Map`` that can hold heterogenous collections of any other type.
931931

932932
The core types with their general mappings are listed below:
933933

@@ -936,24 +936,24 @@ The core types with their general mappings are listed below:
936936
+========================+===========================================================================================================================+
937937
| Null | :const:`None` |
938938
+------------------------+---------------------------------------------------------------------------------------------------------------------------+
939-
| Boolean | ``bool`` |
939+
| Boolean | :class:`bool` |
940940
+------------------------+---------------------------------------------------------------------------------------------------------------------------+
941-
| Integer | ``int`` |
941+
| Integer | :class:`int` |
942942
+------------------------+---------------------------------------------------------------------------------------------------------------------------+
943-
| Float | ``float`` |
943+
| Float | :class:`float` |
944944
+------------------------+---------------------------------------------------------------------------------------------------------------------------+
945-
| String | ``str`` |
945+
| String | :class:`str` |
946946
+------------------------+---------------------------------------------------------------------------------------------------------------------------+
947-
| Bytes :sup:`[1]` | ``bytearray`` |
947+
| Bytes :sup:`[1]` | :class:`bytearray` |
948948
+------------------------+---------------------------------------------------------------------------------------------------------------------------+
949-
| List | ``list`` |
949+
| List | :class:`list` |
950950
+------------------------+---------------------------------------------------------------------------------------------------------------------------+
951-
| Map | ``dict`` |
951+
| Map | :class:`dict` |
952952
+------------------------+---------------------------------------------------------------------------------------------------------------------------+
953953

954954
.. Note::
955955

956-
1. `Bytes` is not an actual Cypher type but is transparently passed through when used in parameters or query results.
956+
1. ``Bytes`` is not an actual Cypher type but is transparently passed through when used in parameters or query results.
957957

958958

959959
In reality, the actual conversions and coercions that occur as values are passed through the system are more complex than just a simple mapping.
@@ -987,7 +987,7 @@ Path :class:`neo4j.graph.Path`
987987
Node
988988
====
989989

990-
.. autoclass:: neo4j.graph.Node()
990+
.. autoclass:: neo4j.graph.Node
991991

992992
.. describe:: node == other
993993

@@ -1022,6 +1022,8 @@ Node
10221022

10231023
.. autoattribute:: id
10241024

1025+
.. autoattribute:: element_id
1026+
10251027
.. autoattribute:: labels
10261028

10271029
.. automethod:: get
@@ -1036,7 +1038,7 @@ Node
10361038
Relationship
10371039
============
10381040

1039-
.. autoclass:: neo4j.graph.Relationship()
1041+
.. autoclass:: neo4j.graph.Relationship
10401042

10411043
.. describe:: relationship == other
10421044

@@ -1076,6 +1078,8 @@ Relationship
10761078

10771079
.. autoattribute:: id
10781080

1081+
.. autoattribute:: element_id
1082+
10791083
.. autoattribute:: nodes
10801084

10811085
.. autoattribute:: start_node
@@ -1097,7 +1101,7 @@ Relationship
10971101
Path
10981102
====
10991103

1100-
.. autoclass:: neo4j.graph.Path()
1104+
.. autoclass:: neo4j.graph.Path
11011105

11021106
.. describe:: path == other
11031107

@@ -1134,108 +1138,16 @@ Path
11341138
Spatial Data Types
11351139
******************
11361140

1141+
.. include:: types/_spatial_overview.rst
11371142

1138-
Cypher has built-in support for handling spatial values (points),
1139-
and the underlying database supports storing these point values as properties on nodes and relationships.
1140-
1141-
https://neo4j.com/docs/cypher-manual/current/syntax/spatial/
1142-
1143-
1144-
================= =====================================
1145-
Cypher Type Python Type
1146-
================= =====================================
1147-
Point :class:`neo4j.spatial.Point`
1148-
1149-
Point (Cartesian) :class:`neo4j.spatial.CartesianPoint`
1150-
Point (WGS-84) :class:`neo4j.spatial.WGS84Point`
1151-
================= =====================================
1152-
1153-
1154-
Point
1155-
=====
1156-
1157-
1158-
.. autoclass:: neo4j.spatial.Point
1159-
:members:
1160-
1161-
1162-
CartesianPoint
1163-
==============
1164-
1165-
.. autoclass:: neo4j.spatial.CartesianPoint
1166-
:show-inheritance:
1167-
1168-
.. autoproperty:: srid
1169-
1170-
.. autoproperty:: x
1171-
1172-
.. autoproperty:: y
1173-
1174-
.. autoproperty:: z
1175-
1176-
.. automethod:: count
1177-
1178-
.. automethod:: index
1179-
1180-
1181-
.. code-block:: python
1182-
1183-
point=CartesianPoint((1.23, 4.56)
1184-
1185-
print(point.x, point.y)
1186-
1187-
1188-
.. code-block:: python
1189-
1190-
point=CartesianPoint((1.23, 4.56, 7.89)
1191-
1192-
print(point.x, point.y, point.z)
1193-
1194-
1195-
WGS84Point
1196-
==========
1197-
1198-
.. autoclass:: neo4j.spatial.WGS84Point
1199-
:show-inheritance:
1200-
1201-
.. autoproperty:: srid
1202-
1203-
.. autoproperty:: x
1204-
1205-
.. autoproperty:: y
1206-
1207-
.. autoproperty:: z
1208-
1209-
.. autoproperty:: longitude
1210-
1211-
.. autoproperty:: latitude
1212-
1213-
.. autoproperty:: height
1214-
1215-
.. automethod:: count
1216-
1217-
.. automethod:: index
1218-
1219-
1220-
1221-
1222-
.. code-block:: python
1223-
1224-
point=WGS84Point((1.23, 4.56))
1225-
print(point.longitude, point.latitude)
1226-
1227-
1228-
.. code-block:: python
1229-
1230-
point=WGS84Point((1.23, 4.56, 7.89))
1231-
print(point.longitude, point.latitude, point.height)
1143+
See topic :ref:`spatial-data-types` for more details.
12321144

12331145

12341146
*******************
12351147
Temporal Data Types
12361148
*******************
12371149

1238-
.. include:: types/temporal.rst
1150+
.. include:: types/_temporal_overview.rst
12391151

12401152
See topic :ref:`temporal-data-types` for more details.
12411153

docs/source/async_api.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ Async API Documentation
1414

1515
.. versionadded:: 5.0
1616

17+
.. warning::
18+
There are known issue with Python 3.8 and the async driver where it
19+
gradually slows down. Generally, it's recommended to use the latest
20+
supported version of Python for best performance, stability, and security.
21+
1722
******************
1823
AsyncGraphDatabase
1924
******************
2025

2126
Async Driver Construction
2227
=========================
2328

24-
The :class:`neo4j.AsyncDriver` construction is done via a `classmethod` on the :class:`neo4j.AsyncGraphDatabase` class.
29+
The :class:`neo4j.AsyncDriver` construction is done via a ``classmethod`` on the :class:`neo4j.AsyncGraphDatabase` class.
2530

2631
.. autoclass:: neo4j.AsyncGraphDatabase
2732
:members: driver
@@ -76,7 +81,7 @@ Other authentication methods are described under :ref:`auth-ref`.
7681
URI
7782
===
7883

79-
On construction, the `scheme` of the URI determines the type of :class:`neo4j.AsyncDriver` object created.
84+
On construction, the ``scheme`` of the URI determines the type of :class:`neo4j.AsyncDriver` object created.
8085

8186
Available valid URIs:
8287

@@ -393,7 +398,7 @@ Explicit transactions support multiple statements and must be created with an ex
393398

394399
This creates a new :class:`neo4j.AsyncTransaction` object that can be used to run Cypher.
395400

396-
It also gives applications the ability to directly control `commit` and `rollback` activity.
401+
It also gives applications the ability to directly control ``commit`` and ``rollback`` activity.
397402

398403
.. autoclass:: neo4j.AsyncTransaction()
399404

@@ -511,14 +516,14 @@ A :class:`neo4j.AsyncResult` is attached to an active connection, through a :cla
511516

512517
.. automethod:: graph
513518

514-
**This is experimental.** (See :ref:`filter-warnings-ref`)
515-
516519
.. automethod:: value
517520

518521
.. automethod:: values
519522

520523
.. automethod:: data
521524

525+
.. automethod:: to_df
526+
522527
.. automethod:: closed
523528

524529
See https://neo4j.com/docs/python-manual/current/cypher-workflow/#python-driver-type-mapping for more about type mapping.

0 commit comments

Comments
 (0)