Skip to main content

OrchidDB for Python

Compile Cypher, Gremlin and SPARQL to SQL, execute through a caller-owned engine, and consume Arrow batches. No DuckDB driver is bundled or imported by the library. The compiler does not touch your data. Graph mapping and schema metadata are explicit.

python -m pip install -e '.[test]'
export ORCHIDDB_NATIVE_LIBRARY=/absolute/path/liborchiddb_compiler.dylib
python examples/people.py
pytest

Build the matching native compiler from OrchidDB-native using NATIVE_REVISION and its pinned CORE_REVISION. Release wheels bundle this compiler for their platform; source installs require the explicit library path. No network downloads happen at import time. ABI and core revision are validated. An explicit development library may report the pinned revision with a -dirty suffix; bundled release libraries require an exact match.

from orchiddb import Compiler, DuckDBEngine, Graph
# connection is your existing DuckDB connection; see examples/people.py for mapping.
graph = Graph(Compiler(), DuckDBEngine(connection), tables=tables, nodes=nodes)
with graph.query_arrow("MATCH (p:Person) WHERE p.name=$name RETURN p.name AS name",
                       parameters={"name": "Ada"}, batch_size=65536) as reader:
    print(reader.schema)
    for batch in reader:
        consume(batch)  # pyarrow.RecordBatch; no row or JSON conversion

The reader closes on context exit, including exceptions. Retained PyArrow batches own their buffers. The adapter never closes the borrowed connection, commits, rolls back, configures extensions, or installs UDFs. Do not reuse that connection until the reader is closed. Overlapping readers through the same adapter fail. Register UDFs yourself and pass their compiler signatures via functions.

graph.plan(query) returns SQL without executing it. Compiler.compile(request) accepts the shared v1 JSON-shaped request; use language="gremlin" or "sparql" with Graph for those languages. SQL support is deliberately narrower than the managed engine's conformance suite. Parameters are specialized into SQL; recompile when values or metadata change. Unsupported queries raise CompilationError.

Implement the ArrowEngine protocol for another backend: provide dialect and a context manager yielding a pyarrow.RecordBatchReader. PostgreSQL SQL rendering is supported by core; cross-engine federation is not implemented. Caller controls connections, Arrow allocation, caches and transaction boundaries.

Releases

CI builds pinned native code and runs real Arrow/DuckDB tests. The manual release workflow requires a matching v0.1.0 tag, builds platform wheels, and publishes to PyPI via trusted publishing. Configure PyPI's orchiddb trusted publisher for this repository, workflow release.yml, environment pypi. The package name was unregistered when checked; this does not reserve it. No release is published until maintainers configure the registry and dispatch the workflow.

Licensed under the OrchidDB GPL-3.0-only license.

DuckDB Arrow export follows its Python Arrow API. Arrow batching does not itself guarantee that an engine streams query execution; execution buffering and cancellation remain backend-specific.

Release files for orchiddb 0.1.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 orchiddb 0.1.0
File Size Uploaded
orchiddb-0.1.0.tar.gz 20.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for orchiddb 0.1.0
File Interpreter ABI Platform
orchiddb-0.1.0-py3-none-macosx_26_0_arm64.whl Python 3 none macOS 26.0+ ARM64 Details

Total release size: 17.2 MB

Release files / orchiddb-0.1.0.tar.gz

Download URL orchiddb-0.1.0.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2a7642ca34b23cdd5395cde848a59a8bff37a212706fc5fed99e00ebdd9f9658
BLAKE2b-256 checksum
How to use checksums
1d09e2309fc944e0bd7c26a3ce1494124c7d611d2ab6823acdcd139c46c3b0a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 26, 2026.

Transparency log

Release files / orchiddb-0.1.0-py3-none-macosx_26_0_arm64.whl

Download URL orchiddb-0.1.0-py3-none-macosx_26_0_arm64.whl
Size 17.1 MB
Tags Python 3 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
e44d4e082b994ccf2a5e00dec6fcb87649b3d975b469ad77a9d87c2d8b430ca2
BLAKE2b-256 checksum
How to use checksums
48ca20e8f9c1e6a90f180c093f17cc545239c01caed7af44d22fbf35e8019132
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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