ZypherDB
An embedded graph database that speaks openCypher.
ZypherDB is to graphs what SQLite is to tables: a database that lives inside your process and keeps its data in a directory, with no server to run. You store nodes and relationships and query them in openCypher, the language of Neo4j. Several processes can share a database, and a crash never leaves it half-written. The engine is written in Zig, on LMDB.
Install
pip install zypherdb
Python 3.10 or later, on Linux (x86_64, aarch64), macOS (Apple silicon, Intel) and Windows
(x86_64). No dependencies (on Windows, only tzdata).
A first look
Who may open a door, through groups nested to any depth, and at what times:
from zypherdb import Database
db = Database("lab.db") # a directory, created if missing
db.query("CREATE INDEX FOR (d:Door) ON (d.name)") # doors are looked up by name
db.query("""
CREATE (ana:Person {name: 'Ana'}), (bo:Person {name: 'Bo'}),
(staff:Group {name: 'Lab staff'}), (bsl3:Group {name: 'BSL-3'}),
(airlock:Door {name: 'BSL-3 airlock'})
CREATE (ana)-[:MEMBER_OF]->(bsl3)-[:PART_OF]->(staff),
(bo)-[:MEMBER_OF]->(staff),
(bsl3)-[:MAY_OPEN {from: localtime('07:00'), until: localtime('19:00')}]->(airlock)
""")
rows = db.query("""
MATCH (:Door {name: $door})<-[rule:MAY_OPEN]-(:Group)<-[:PART_OF*0..]-(:Group)<-[:MEMBER_OF]-(p:Person)
RETURN p.name, rule.from, rule.until
""", door="BSL-3 airlock")
print(rows) # [['Ana', datetime.time(7, 0), datetime.time(19, 0)]]
Results come back as Python values: numbers, strings, lists, dicts, datetime types with their
time zones, and nodes, relationships and paths.
Full-text search, with stemming and BM25 ranking, in Neo4j's syntax:
db.query("CREATE (:Protocol {title: 'Airlock', body: 'Spray the doors before opening them'})")
db.query("""
CREATE FULLTEXT INDEX protocols FOR (p:Protocol) ON EACH [p.title, p.body]
OPTIONS {indexConfig: {`fulltext.analyzer`: 'english'}}
""")
print(db.query("""
CALL db.index.fulltext.queryNodes('protocols', 'door AND open') YIELD node, score
RETURN node.title, score
""")) # [['Airlock', 0.5753641449035617]]
And a look at how a query runs: explain returns its plan, and profile runs it and counts the
rows each step made:
def show(plan, depth=0):
print(" " * depth + f"{plan['operator']} {plan['details']} rows: {plan['rows']}")
for child in plan["children"]:
show(child, depth + 1)
rows, plan = db.profile("""
MATCH (:Door {name: $door})<-[rule:MAY_OPEN]-(:Group)<-[:PART_OF*0..]-(:Group)<-[:MEMBER_OF]-(p:Person)
RETURN p.name, rule.from, rule.until
""", door="BSL-3 airlock")
show(plan)
Return p.name, rule.from, rule.until rows: 1
Expand(All) (:Group)<-[:MEMBER_OF]-(p:Person) rows: 1
VarLengthExpand(All) (:Group)<-[:PART_OF*0..]-(:Group) rows: 1
Expand(All) (:Door {name: $door})<-[rule:MAY_OPEN]-(:Group) rows: 1
NodeIndexSeek (:Door {name: $door}) rows: 1
The tutorial goes from here to a complete access-control system in twenty short steps.
What it can do
- openCypher:
MATCHandOPTIONAL MATCH, variable-length and shortest paths,WITH,UNWIND,UNION, subqueries,EXISTS { }andCOUNT { };CREATE,MERGE,SET,REMOVE,DELETE,FOREACH;LOAD CSV; every aggregate; string, list, math, temporal and graph functions. - Values: integers, floats, strings, booleans, lists, maps, and the six temporal types with time zones. Properties can also hold maps, so a node can carry a document.
- Indexes: property indexes for equality and ranges, on node labels and relationship types, and on fields inside documents; full-text indexes in English and Spanish; uniqueness constraints.
- Storage: transactions, crash safety, three durability levels, one writer and any number of readers across processes (readers never wait), and an integrity checker.
- Queries: plans of operators with index seeks,
EXPLAINandPROFILE, prepared statements and a statement cache.
ZypherDB passes all 3202 scenarios of the openCypher TCK that expect a result, and all 694 that expect an error. The Cypher reference lists what it does not support yet. Python is the first language binding; C, C++ and JavaScript come next.
Documentation
acasadom.github.io/zypherdb has the tutorial, the Cypher and Python references, and how it works inside: the architecture, the storage layout, the query planner, performance and testing (fuzzers, crash and fault injection, the TCK).
Building from source
You need Zig 0.17: zig build test runs the tests and
pip install . builds the Python package. The
contributing guide has the rest.
License
Apache License 2.0. ZypherDB includes LMDB, libmdbx, the IANA time-zone database, and data and algorithms from Unicode and Snowball, under their own licenses: see THIRD_PARTY_NOTICES.md.
Metadata
Release files for zypherdb 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zypherdb-0.2.0.tar.gz | 1.2 MB | With provenance | Details for zypherdb-0.2.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| zypherdb-0.2.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for zypherdb-0.2.0-cp310-abi3-win_amd64.whl |
| zypherdb-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for zypherdb-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| zypherdb-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for zypherdb-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| zypherdb-0.2.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for zypherdb-0.2.0-cp310-abi3-macosx_11_0_arm64.whl |
| zypherdb-0.2.0-cp310-abi3-macosx_10_13_x86_64.whl | CPython 3.10 | abi3 | macOS 10.13+ x86-64 | Details for zypherdb-0.2.0-cp310-abi3-macosx_10_13_x86_64.whl |
Total release size: 6.7 MB
Release files / zypherdb-0.2.0.tar.gz
| Download URL | zypherdb-0.2.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5750a0a9b9af42d1a59649e8482a42784296d5edba3df64c1af84695ab9d58f4
|
|
BLAKE2b-256 checksum How to use checksums |
8c512c7c6b7c8f146dddfb562404e8c88aabae26937f84da6ed7c1700a48b118
|
| 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 7, 2026.
Transparency logRelease files / zypherdb-0.2.0-cp310-abi3-win_amd64.whl
| Download URL | zypherdb-0.2.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1d05516dc26753783a2d81cc70650c4a402ddd6f7cd678e12a232e307c9a1fc2
|
|
BLAKE2b-256 checksum How to use checksums |
cec7a2f8a7e67282503a2e720f38b95db6180578178228883d770655f2c298ac
|
| 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 7, 2026.
Transparency logRelease files / zypherdb-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | zypherdb-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b37631d40ffdfc11a4220629e044ba623b2ec3155d8864e9d7cc009106edc3f1
|
|
BLAKE2b-256 checksum How to use checksums |
0ab557e5bb6cba74cb1e39af2ff3b785d35f029c86494ae943913238b3283d3d
|
| 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 7, 2026.
Transparency logRelease files / zypherdb-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | zypherdb-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5b4b083e4802b940c9a8536becfa39c0bf98e540385381155ec3810e152ff0e6
|
|
BLAKE2b-256 checksum How to use checksums |
203edc4dc84438531844062b256f1b353a825963dbe4a34bd9cbc25d8056d03f
|
| 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 7, 2026.
Transparency logRelease files / zypherdb-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | zypherdb-0.2.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
15f2cd8520712588d12065b9708c307dd19b47c4adf33dd6ce9bdf11930d7d1f
|
|
BLAKE2b-256 checksum How to use checksums |
e052c34c1682c70e43a97567a6acf9783e90a663f0de684d48bae1168a77523a
|
| 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 7, 2026.
Transparency logRelease files / zypherdb-0.2.0-cp310-abi3-macosx_10_13_x86_64.whl
| Download URL | zypherdb-0.2.0-cp310-abi3-macosx_10_13_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 abi3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
ebf7031f9c06413e566f462d63fa8a645575f5759511368477181f5ed82f2f7c
|
|
BLAKE2b-256 checksum How to use checksums |
bf96c7ea92b4bb1bb9cec617308e74ab6aa0f86ce72be0cbee77c84f61ca839f
|
| 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 7, 2026.
Transparency logSecurity for zypherdb 0.2.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
All 6 files in this release have been uploaded with provenance metadata.
Attestation for zypherdb-0.2.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 7, 2026.
Transparency logA 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.