Skip to content

drivine-python

PyPI License

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

A graph database client for Python, supporting Neo4j, Memgraph, FalkorDB, Amazon Neptune and Oracle (SQL/PGQ). 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.

Neptune connects for the PersistenceManager; the object manager runs on the others. 0.1 is an alpha release: the API may still change. See the design for how it came about.

On Node.js or the JVM? Drivine (npm install @liberation-data/drivine) and drivine4j (org.drivine:drivine4j) are its TypeScript and Kotlin & Java twins, with the same object manager, query DSL, schema management and engines. The three share a storage format: a store written from any of them is read, stamped and checked alike by the others.

pip install "drivine[neo4j]" # Neo4j, Memgraph, Neptune
pip install "drivine[falkordb]" # FalkorDB
pip install "drivine[oracle]" # Oracle 23ai and 26ai, through python-oracledb in thin mode
pip install "drivine[pilgrim]" # DrivineAssembly, for pi-pilgrim; optional

Python 3.11 or newer.