Skip to main content

ZypherDB

An embedded graph database that speaks openCypher.

CI License: Apache 2.0 Python Docs

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-one short steps.

What it can do

  • openCypher: MATCH and OPTIONAL MATCH, variable-length and shortest paths, WITH, UNWIND, UNION, subqueries, EXISTS { } and COUNT { }; 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, EXPLAIN and PROFILE, 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.3.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 zypherdb 0.3.0
File Size Uploaded Provenance Actions
zypherdb-0.3.0.tar.gz 1.3 MB With provenance Details for zypherdb-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for zypherdb 0.3.0
File Actions
zypherdb-0.3.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for zypherdb-0.3.0-cp310-abi3-win_amd64.whl
zypherdb-0.3.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.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
zypherdb-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for zypherdb-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
zypherdb-0.3.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for zypherdb-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
zypherdb-0.3.0-cp310-abi3-macosx_10_13_x86_64.whl CPython 3.10 abi3 macOS 10.13+ x86-64 Details for zypherdb-0.3.0-cp310-abi3-macosx_10_13_x86_64.whl

Total release size: 7.4 MB

Release files / zypherdb-0.3.0.tar.gz

Download URL zypherdb-0.3.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
4ab31f514378618932f03470d57d1b8dbbf7e90fe2c97dea6571c1651f016eb0
BLAKE2b-256 checksum
How to use checksums
1bb7d6b3e6eceac0cdabbfeafe94363569aea5602c24aef4e564f018be6134ef
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 21, 2026.

Transparency log

Release files / zypherdb-0.3.0-cp310-abi3-win_amd64.whl

Download URL zypherdb-0.3.0-cp310-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
28e647c34d27e465a19630ea17618a3b4d179e9e50b238ad9bc344064f1fa74f
BLAKE2b-256 checksum
How to use checksums
2ec022b84f249cb65bb821c10ef7c839d8591303b269dc91761a36f4538843cd
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 21, 2026.

Transparency log

Release files / zypherdb-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL zypherdb-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
2a257140a739d6b3fe7554f5a2adfbec4196a0c8b7cbdb20079fa2eee6db1b75
BLAKE2b-256 checksum
How to use checksums
178d5f5644e95cb4bd61ce1869d675c7e3c31dc6f17f43d350d5f3d641f2574f
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 21, 2026.

Transparency log

Release files / zypherdb-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL zypherdb-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.2 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
244c57af49c88b02bcc78f9e4498f1ab5bb782fce5d3c506e096c51030f38dad
BLAKE2b-256 checksum
How to use checksums
f9323e243eb057b86f5365c92b29f677ee44ab51e332077d49c40995e8c5085f
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 21, 2026.

Transparency log

Release files / zypherdb-0.3.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL zypherdb-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0bb810b1843eb25404510a1032d8e0c4d555686f2c5d869c49e48fdd9225e0d1
BLAKE2b-256 checksum
How to use checksums
279fa53e6b7e96dd4983bb577532b8d0b5617ef4a9ad1b4f1bf9fe31e63d4fbd
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 21, 2026.

Transparency log

Release files / zypherdb-0.3.0-cp310-abi3-macosx_10_13_x86_64.whl

Download URL zypherdb-0.3.0-cp310-abi3-macosx_10_13_x86_64.whl
Size 1.2 MB
Tags CPython 3.10 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
5d779c42d0b7718b44f4f90356a559e24490d8607624f37aea53152bc98956e1
BLAKE2b-256 checksum
How to use checksums
23b3a55e635611986f6fdf05bb36d3528b5263ee4dff24176ed1cd42d67c95b2
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 21, 2026.

Transparency log

Security for zypherdb 0.3.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.

Select from 6 files

Attestation for zypherdb-0.3.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 21, 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