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 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.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 zypherdb 0.1.0
File Size Uploaded Provenance Actions
zypherdb-0.1.0.tar.gz 1.1 MB With provenance Details for zypherdb-0.1.0.tar.gz

Built distributions (wheels)

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

Total release size: 5.9 MB

Release files / zypherdb-0.1.0.tar.gz

Download URL zypherdb-0.1.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
2ee7ff02ab4c843731e103eab03c1f209f81371df66e2adca44b76b71f91cee0
BLAKE2b-256 checksum
How to use checksums
07d4fb0d37d935ab226c27b5f7894c8967e78cd163a0b8b628da720d0f5d2df6
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 Oct 28, 2026.

Transparency log

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

Download URL zypherdb-0.1.0-cp310-abi3-win_amd64.whl
Size 1.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f29bb9e9ac17b1617dae119f6a56b4d812e63374a745a6a3ff8e0aa4aae258c9
BLAKE2b-256 checksum
How to use checksums
92b3a4858af2f15f3b4043eaa3a2444853e71b5a684fe933c48aafae51f0c4c8
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 Oct 28, 2026.

Transparency log

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

Download URL zypherdb-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c8ef73d8d2aa1705f39bd0d73c6d31eeeb3807fe3be85c9d1beb806fcdc83149
BLAKE2b-256 checksum
How to use checksums
cf294a7b3e469e3e1584a153b0c19189c30e1da3c3a705d5694dbc7513df396b
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 Oct 28, 2026.

Transparency log

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

Download URL zypherdb-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 926.6 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
7e7da14504f7d9234cd58621ba5256627b938e902f7f607895725adf6f9088a3
BLAKE2b-256 checksum
How to use checksums
7ac82f02ef176fa479dc54e5164fe82f8d8cf7b337f517f250189892c76df7b9
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 Oct 28, 2026.

Transparency log

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

Download URL zypherdb-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 884.5 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b0e46bad25ef36d387e2b202bf8a1506f60c8c8b10192a051f24af2465f92c19
BLAKE2b-256 checksum
How to use checksums
05ef01770bfa04c5844076496724d91136708b8d4b9132a0c415b50bab3ea370
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 Oct 28, 2026.

Transparency log

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

Download URL zypherdb-0.1.0-cp310-abi3-macosx_10_13_x86_64.whl
Size 978.4 kB
Tags CPython 3.10 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
d3b3ba2105b6d3bb931379843c600e34bec8e80b822a8f810e7f647c0ac56801
BLAKE2b-256 checksum
How to use checksums
10ce4526f62daedf92ed4ca5af77ee9892bb59b77171fff6b263cf1040b888e5
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 Oct 28, 2026.

Transparency log

Security for zypherdb 0.1.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.1.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 Oct 28, 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