See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
- No breaking or major changes.
- No breaking or major changes.
- Python 3.13 support added.
- Deprecated setting attributes on
Neo4jError
likemessage
andcode
. - Deprecated undocumented method
Neo4jError.hydrate
.
It's internal and should not be used by client code.
- No breaking or major changes.
- Made
neo4j.auth_management.RotatingClientCertificateProvider
and...AsyncRotatingClientCertificateProvider
(in preview) abstract classes, meaning they can no longer be instantiated directly.
Please use the provided factory methods instead:neo4j.auth_management.RotatingClientCertificateProvider.rotating
and....AsyncRotatingClientCertificateProvider.rotating()
respectively.
- No breaking or major changes.
SummaryNotificationPosition
has been deprecated in favor ofSummaryInputPosition
.
- No breaking or major changes.
- Implemented a hierarchical logger structure to improve log source
identification and traceability.
Introduced child loggers:neo4j.io
: For socket and bolt protocol related logging.neo4j.pool
: For logs pertaining to connection pooling and routing.neo4j.auth_management
: For logging inside the provided AuthManager implementations.
- No breaking or major changes.
- Python 3.12 support added
- Deprecated using
neo4j.Driver
andneo4j.AsyncDriver
after calling.close()
on them, except for calling.close()
again, which has no effects.
- No breaking or major changes.
neo4j.auth_management.ExpiringAuth
'sexpires_in
(in preview) was replaced byexpires_at
, which is a unix timestamp.
You can useExpiringAuth(some_auth).expires_in(123)
instead.
- Renamed experimental
neo4j.RoutingControl.READERS
toREAD
andWRITERS
toWRITE
. - Renamed experimental
driver.query_bookmark_manager
toexecute_query_bookmark_manager
. - Query argument to experimental
driver.execute_query
not is typedLiteralString
instead ofstr
to help mitigate accidental Cypher injections. There are rare use-cases where a computed string is necessary. Please use# type: ignore
, ortyping.cast
to suppress the type checking in those cases.
- Deprecated importing from
neo4j.work
and its submodules. Everything should be imported directly fromneo4j
instead.
- No breaking or major changes.
- Undocumented helper methods
Neo4jError.is_fatal_during_discovery
andNeo4jError.invalidates_all_connections
have been deprecated and will be removed without replacement in version 6.0.
- Python 3.11 support added
- Removed undocumented, unused
neo4j.data.map_type
- Query strings are now typed
LiteralString
instead ofstr
to help mitigate accidental Cypher injections. There are rare use-cases where a computed string is necessary. Please use# type: ignore
, ortyping.cast
to suppress the type checking in those cases. - The experimental bookmark manager feature was changed to no longer track
bookmarks per database.
This effectively changes the signature of almost all bookmark manager related methods:neo4j.BookmarkManger
andneo4j.AsyncBookmarkManger
abstract base classes:update_bookmarks
has no longer adatabase
argument.get_bookmarks
has no longer adatabase
argument.- The
get_all_bookmarks
method was removed. - The
forget
method was removed.
neo4j.GraphDatabase.bookmark_manager
andneo4j.AsyncGraphDatabase.bookmark_manager
factory methods:initial_bookmarks
is no longer a mapping from database name to bookmarks but plain bookmarks.bookmarks_supplier
no longer receives the database name as an argument.bookmarks_consumer
no longer receives the database name as an argument.
- No breaking or major changes.
- Python 3.10 support added
- Python 3.6 support has been dropped.
Result
,Session
, andTransaction
can no longer be imported fromneo4j.work
. They should've been imported fromneo4j
all along.
Remark: It's recommended to import everything needed directly fromnoe4j
if available, not its submodules or subpackages.- Experimental pipelines feature has been removed.
- Async driver (i.e., support for asyncio) has been added.
ResultSummary.server.version_info
has been removed.
UseResultSummary.server.agent
,ResultSummary.server.protocol_version
, or call thedbms.components
procedure instead.- SSL configuration options have been changed:
trust
has been deprecated and will be removed in a future release.
Usetrusted_certificates
instead. See the API documentation for more details.
neo4j.time
module:Duration
- The constructor does not accept
subseconds
anymore.
Usemilliseconds
,microseconds
, ornanoseconds
instead. - The property
subseconds
has been removed.
Usenanoseconds
instead. - The property
hours_minutes_seconds
has been removed.
Usehours_minutes_seconds_nanoseconds
instead. - For all math operations holds: they are element-wise on
(
months
,days
,nanoseconds
). This affects (i.e., changes) the working of//
,%
,/
, and*
.- Years are equal to 12 months.
- Weeks are equal to 7 days.
seconds
,milliseconds
,microseconds
, andnanoseconds
are implicitly converted tonanoseconds
orseconds
as fit.
- Multiplication and division allow for floats but will always result in integer values (round to nearest even).
- The constructor does not accept
Time
- The constructor does not accept
float
s forsecond
anymore.
Usenanosecond
instead. - Ticks are now nanoseconds since midnight (
int
).- The property
ticks_ns
has been renamed toticks
.
The oldticks
is no longer supported. - The property
from_ticks_ns
has been renamed tofrom_ticks
.
The oldfrom_ticks
is no longer supported.
- The property
- The property
second
returns anint
instead of afloat
.
Usenanosecond
to get the sub-second information. - The property
hour_minute_second
has been removed.
Usehour_minute_second_nanosecond
instead.
- The constructor does not accept
DateTime
- The property
hour_minute_second
has been removed.
Usehour_minute_second_nanosecond
instead. - The property
second
returns anint
instead of afloat
.
Usenanosecond
to get the sub-second information.
- The property
- Creation of a driver with
bolt[+s[sc]]://
scheme and a routing context has been deprecated and will raise an error in the Future. The routing context was and will be silently ignored until then. - Bookmarks
Session.last_bookmark
was deprecated. Its behaviour is partially incorrect and cannot be fixed without breaking its signature.
UseSession.last_bookmarks
instead.neo4j.Bookmark
was deprecated.
Useneo4j.Bookmarks
instead.
- Deprecated closing of driver and session objects in their destructor.
This behaviour is non-deterministic as there is no guarantee that the
destructor will ever be called. A
ResourceWarning
is emitted instead.
Make sure to configure Python to output those warnings when developing your application locally (it does not by default). - Result scope:
- Records of Results cannot be accessed (
peek
,single
,iter
, ...) after their owning transaction has been closed, committed, or rolled back. Previously, this would yield undefined behavior. It now raises aResultConsumedError
. - Records of Results cannot be accessed (
peek
,single
,iter
, ...) after the Result has been consumed (Result.consume()
). Previously, this would always yield no records. It now raises aResultConsumedError
. - New method
Result.closed()
can be used to check for this condition if necessary.
- Records of Results cannot be accessed (
- The undocumented return value of
driver.verify_connectivity()
has been removed. If you need information about the remote server, usedriver.get_server_info()
instead. - Transaction functions (a.k.a. managed transactions):
The first argument of transaction functions is now aManagedTransaction
object. It behaves exactly like a regularTransaction
object, except it does not offer thecommit
,rollback
,close
, andclosed
methods.
Those methods would have caused a hard to interpreted error previously. Hence, they have been removed. - Deprecated Nodes' and Relationships'
id
property (int
) in favor ofelement_id
(str
).
This also affectsGraph
objects as indexinggraph.nodes[...]
andgraph.relationships[...]
with integers has been deprecated in favor of indexing them with strings. ServerInfo.connection_id
has been deprecated and will be removed in a future release. There is no replacement as this is considered internal information.- Output of logging helper
neo4j.debug.watch
changes- ANSI colour codes for log output are now opt-in
- Prepend log format with log-level (if colours are disabled)
- Prepend log format with thread name and id
- Deprecated
neo4j.exceptions.Neo4jError.is_retriable()
.
Useneo4j.exceptions.Neo4jError.is_retryable()
instead. - Importing submodules from
neo4j.time
(neo4j.time.xyz
) has been deprecated. Everything needed should be imported fromneo4j.time
directly. neo4j.spatial.hydrate_point
andneo4j.spatial.dehydrate_point
have been deprecated without replacement. They are internal functions.- Importing
neo4j.packstream
has been deprecated. It's internal and should not be used by client code. - Importing
neo4j.routing
has been deprecated. It's internal and should not be used by client code. - Importing
neo4j.config
has been deprecated. It's internal and should not be used by client code. neoj4.Config
,neoj4.PoolConfig
,neoj4.SessionConfig
, andneoj4.WorkspaceConfig
have been deprecated without replacement. They are internal classes.- Importing
neo4j.meta
has been deprecated. It's internal and should not be used by client code.ExperimantalWarning
should be imported directly fromneo4j
.neo4j.meta.version
is exposed throughneo4j.__vesrion__
- Importing
neo4j.data
has been deprecated. It's internal and should not be used by client code.Record
should be imported directly fromneo4j
instead.neo4j.data.DataHydrator
andneo4j.data.DataDeydrator
have been removed without replacement. - Removed undocumented config options that had no effect:
protocol_version
andinit_size
. - Introduced
neo4j.exceptions.SessionError
that is raised when trying to execute work on a closed or otherwise terminated session. - Removed deprecated config options
update_routing_table_timeout
andsession_connection_timeout
.
Server-side keep-alives communicated through configuration hints together with the config optionconnection_acquisition_timeout
are sufficient to avoid the driver getting stuck. - Deprecate
Session.read_transaction
andSession.write_transaction
in favor ofSession.execute_read
andSession.execute_write
respectively.
- Python 3.5 support has been dropped.
- Python 3.9 support added
- No breaking or major changes.
- Routing context is now forwarded to the server for when required by server-side routing
- The package version has jumped from
1.7
directly to4.0
, in order to bring the version in line with Neo4j itself. - The package can now no longer be installed as
neo4j-driver
; usepip install neo4j
instead. - The
neo4j.v1
subpackage is now no longer available; all imports should be taken from theneo4j
package instead. - Changed
session(access_mode)
from a positional to a keyword argument - The
bolt+routing
scheme is now namedneo4j
- Connections are now unencrypted by default; to reproduce former behaviour, add
encrypted=True
to Driver configuration - Removed
transaction.success
flag usage pattern.
- Python 3.8 supported.
- Python 3.7 supported.
- Python 3.6 supported.
- Python 3.5 supported.
- Python 3.4 support has been dropped.
- Python 3.3 support has been dropped.
- Python 3.2 support has been dropped.
- Python 3.1 support has been dropped.
- Python 3.0 support has been dropped.
- Python 2.7 support has been dropped.