Skip to main content

Drivine: graph database client for TypeScript, Python and the JVM

drivine-python

PyPI License

Docs: drivine.org, for Python, TypeScript, and Kotlin & Java.

Watch: Drivine, graph RAG on any database (4:26)
▶ Watch Drivine in four and a half minutes: graph RAG on any database (4:26, with captions)

A graph database client for Python, supporting Neo4j, Memgraph, FalkorDB, Oracle (SQL/PGQ), Postgres and SQLite as graph stores, plus Amazon Neptune through the low-level API. Async first, with a sync API written from it, typed, and fast: one statement per round trip, no session cache, no lazy loading. It gives you two ways to work with a graph:

  1. PersistenceManager: a low-level API where you write the queries yourself.
  2. Object manager (StatelessGraphObjectManager): a high-level API that maps Pydantic models, with a query DSL whose typed references are stubs generated from your models.

Cypher you write runs on Postgres, Oracle and SQLite too, compiled to SQL. 0.9 is an alpha release: the API may still change.

Install

pip install "drivine[neo4j]"      # Neo4j, Memgraph, Neptune
pip install "drivine[falkordb]"   # FalkorDB
pip install "drivine[oracle]"     # Oracle 23.9 or later, through python-oracledb in thin mode
pip install "drivine[postgres]"   # Postgres 14 or later, through psycopg 3
pip install "drivine[sqlite]"     # SQLite, a graph in a file, through apsw and the SQLite it bundles
pip install "drivine[neo4j,compiler]"  # full-text search (load_matching) on a graph engine

Python 3.11 or newer. A SQLite store and what a transaction gives there are in Connecting.

The SQL stores' extras also install drivine-cypher-compiler, the shared Cypher compiler, a native wheel for Linux with glibc (x86-64 and arm64), macOS on Apple Silicon and Windows x64. On an Intel Mac or musl Linux (Alpine) there is no wheel, so a SQL store's extra doesn't install there; the graph engines' do. Full-text search (load_matching) is the compiler's on every store: on a graph engine, add the compiler extra beside its own to search by text (pip install "drivine[neo4j,compiler]"). See Cypher on a relational database.

Quick start

Describe the database in the environment (DATABASE_TYPE=NEO4J, DATABASE_HOST=localhost, DATABASE_USER, DATABASE_PASSWORD), declare a fragment for a node, then save and load it, each in one statement:

import asyncio
from typing import Annotated

from drivine import DrivineAssembly, NodeFragment, NodeId, refs


class Person(NodeFragment, labels=["Person"]):
    uuid: Annotated[str, NodeId()]
    name: str


async def main() -> None:
    async with DrivineAssembly() as drivine:
        gom = drivine.graph_object_manager()
        await gom.save(Person(uuid="p1", name="Ada"))
        print(await gom.load_all(Person, where=refs(Person).name.eq("Ada")))


asyncio.run(main())

Views that compose fragments and relationships, queries, transactions, schema and the sync API are in the full quick start and the pages after it.

Documentation

License

Apache 2.0.

Metadata

Release files for drivine 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drivine 0.9.0
File Size Uploaded Provenance Actions
drivine-0.9.0.tar.gz 2.2 MB With provenance Details for drivine-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for drivine 0.9.0
File Interpreter ABI Platform Actions
drivine-0.9.0-py3-none-any.whl Python 3 none any Details for drivine-0.9.0-py3-none-any.whl

Total release size: 2.9 MB

Release files / drivine-0.9.0.tar.gz

Download URL drivine-0.9.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
8dcbacf6e51bc483af847671993c2a15dce47307235486a04f8886f3db194450
BLAKE2b-256 checksum
How to use checksums
8b9cb3215a78a1d51571853052145a859f9eeca2940d3837ddfbfc5c098db72e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / drivine-0.9.0-py3-none-any.whl

Download URL drivine-0.9.0-py3-none-any.whl
Size 687.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc4cd63042188f9e43c0b347ace794a304c3241b142327961491f1d1744537ef
BLAKE2b-256 checksum
How to use checksums
1cb747f68e61d5468db014ed37efd541489b96818fc763b1e25247f2c3638188
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for drivine 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for drivine-0.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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