Skip to main content

Python bindings for ZYX graph database engine

Project description

zyxdb

Python bindings for ZYX, a high-performance embeddable graph database engine with Cypher query support.

Installation

pip install zyxdb

Build from source

cd bindings/python
pip install -e ".[test]"

Quick Start

import zyxdb

# Open a database (creates if not exists)
db = zyxdb.Database("/tmp/mydb")

# Create nodes with Cypher
db.execute("CREATE (n:Person {name: $name, age: $age})", name="Alice", age=30)

# Query with iteration
for row in db.execute("MATCH (n:Person) RETURN n.name AS name, n.age AS age"):
    print(row["name"], row["age"])

# Batch insert
db.create_nodes("Person", [
    {"name": "Bob", "age": 25},
    {"name": "Carol", "age": 35},
])

# Transactions with context manager
with db.begin_transaction() as tx:
    tx.execute("CREATE (n:Movie {title: 'Matrix'})")
    tx.execute(
        "MATCH (a:Person {name: 'Alice'}), (m:Movie {title: 'Matrix'}) "
        "CREATE (a)-[:WATCHED]->(m)"
    )
    tx.commit()

# Read-only transaction
with db.begin_read_only_transaction() as tx:
    for row in tx.execute("MATCH (n) RETURN count(n) AS cnt"):
        print(row["cnt"])

# Direct node/edge creation by ID (high performance)
id1 = db.create_node_ret_id("Person", {"name": "Dave"})
id2 = db.create_node_ret_id("Person", {"name": "Eve"})
db.create_edge_by_id(id1, id2, "KNOWS", {"since": 2024})

# Shortest path
path = db.get_shortest_path(id1, id2)

db.close()

Context Manager

with zyxdb.Database("/tmp/mydb") as db:
    db.execute("CREATE (n:Test {x: 1})")
    # Auto-closes on exit

Supported Value Types

Python ZYX
None null
bool bool
int int64
float double
str string
list[float] vector (embeddings)
list[str] string list
list (mixed) heterogeneous list
dict map

API Reference

Database(path, *, open=True)

  • execute(cypher, **params) — Execute Cypher query with keyword parameters
  • begin_transaction() — Start a read-write transaction
  • begin_read_only_transaction() — Start a read-only transaction
  • create_node(label, props) — Create a node (label can be str or list[str])
  • create_node_ret_id(label, props) — Create a node, return its ID
  • create_nodes(label, props_list) — Batch create nodes
  • create_edge_by_id(src_id, dst_id, type, props) — Create edge between known IDs
  • get_shortest_path(start_id, end_id, max_depth=15) — Find shortest path
  • save() — Flush to disk
  • close() — Close the database

Transaction

  • execute(cypher, **params) — Execute within transaction
  • commit() — Commit changes
  • rollback() — Roll back changes
  • is_active — Whether transaction is still active
  • is_read_only — Whether read-only

Result

  • Iterable: for row in result yields dict[str, Any]
  • column_names — List of column names
  • duration — Query execution time (ms)
  • is_success — Whether query succeeded
  • error — Error message or None

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zyxdb-0.1.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

zyxdb-0.1.0-cp313-cp313-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.13Windows x86-64

zyxdb-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

zyxdb-0.1.0-cp313-cp313-macosx_13_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

zyxdb-0.1.0-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

zyxdb-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

zyxdb-0.1.0-cp312-cp312-macosx_13_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

zyxdb-0.1.0-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

zyxdb-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

zyxdb-0.1.0-cp311-cp311-macosx_13_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

zyxdb-0.1.0-cp310-cp310-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10Windows x86-64

zyxdb-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

zyxdb-0.1.0-cp310-cp310-macosx_13_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

zyxdb-0.1.0-cp39-cp39-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.9Windows x86-64

zyxdb-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

zyxdb-0.1.0-cp39-cp39-macosx_13_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

File details

Details for the file zyxdb-0.1.0.tar.gz.

File metadata

  • Download URL: zyxdb-0.1.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zyxdb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3cd90f2b00e0f6d5c6a49f027c54f0a4befde395be90b967fe29c37b12423f1b
MD5 94bcdd239a8d8c369123b0f9e4346e9f
BLAKE2b-256 cda24a3f01ca3e6b3a3db734cf149146304475777b92af1875891c8cd938978d

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0.tar.gz:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: zyxdb-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zyxdb-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 32607226a114a557ff9e9cbb6929221c013a43065e7ce3cb03f2927b9f0842e8
MD5 80624bcddfa248c8d0387f2b8fc1c47a
BLAKE2b-256 3a120fe74f9af00469ef4e00e6ae1c19d1dd56911589fb6e468f088789b53353

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp313-cp313-win_amd64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for zyxdb-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 804e11f42fe0e6734600faae10b089256fc0ab79a862d9e0516179c6f25d81fb
MD5 fb0fc831113038b5ff660a69d926a211
BLAKE2b-256 3fbe7779ca86fd274457b88fa17bec72817e2590a7c666ad735223baca8b81b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for zyxdb-0.1.0-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 51ed0bb74841fe75e4fc2d40e09469f74f152a704c7bce64134ba158bacbc8c7
MD5 0dec5b92278135a3edfc3ccd916f0bb7
BLAKE2b-256 1c297f4af4cc548a839dc48cd9a751844c9a30e86d570c82467a726d95324620

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp313-cp313-macosx_13_0_arm64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: zyxdb-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zyxdb-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fad8a38c393689b6d7e53fc736665bf27eae3dd311b96ba997a119a3d37efbd7
MD5 c57f57f10ad2bbd3348bc2ed6140aa37
BLAKE2b-256 c6c564dbc8d49e27001fd568517a2db2312402202d99372fea3a1b4286a3ad47

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp312-cp312-win_amd64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for zyxdb-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c933578a6e4815b93a6007b8b0a9e38293aa69f005b81e346eab15494bde2bf8
MD5 b3f226dc7a3923f91f9819b7f96cf886
BLAKE2b-256 b7a7270e9b1ef2a4b196904484dadcdc0f8b42960a55950f8c28ebb0d45b1b85

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for zyxdb-0.1.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 ffc3a593b61ecb12ef3f1d86e4e1bb773d5d77a9b6b8283722ac9e7b4c33ee1a
MD5 1816b056162fcd008ddb412202862be3
BLAKE2b-256 0b747a6d0b75585f59f9b6a9b976d57e559167ec0a27326ae2968be200bae2e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp312-cp312-macosx_13_0_arm64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: zyxdb-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zyxdb-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 853da58cf51bfebf10f96624eb80e76d5e943e699df8c4d8f8765d5fca502acc
MD5 3c75a06cf91feeb1f189d02c0a16766a
BLAKE2b-256 ad449a5f6f5b9cd9c152e0c334de05a0d7f2913f3b40899a104eaf69e2473067

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp311-cp311-win_amd64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for zyxdb-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c930f85c7ca1ec001159d394d10bf1938719447fd752440ddebf19e6bac9504
MD5 d059d4723708810c8b92b89728a8b9f8
BLAKE2b-256 780a9883d4830bf6edf39d29a45c26dc7cd2463064840a3c5af0353fa60407ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for zyxdb-0.1.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 be00504290ec5b68befb1944ef63fedf1630857667c865b1b80252da3712c92a
MD5 ecc675c38c221e61549471855bdc03d2
BLAKE2b-256 997acefa4ad026873d4287543097abed1e6420c4b976dacfef027db4eed4f874

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp311-cp311-macosx_13_0_arm64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: zyxdb-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zyxdb-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 17974a636ed7b2ba1ec759e43d4a119478ed7a52677c7219d8afccbe29eb6dc7
MD5 11aa2b25cf65d486cbf913b1d9ca9439
BLAKE2b-256 73a2d2abaa53b338cd50b0f04c319a13709d9b27f59dee79605a08ae0e459d6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp310-cp310-win_amd64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for zyxdb-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7b448a5dfa93b8e363e96f8ccdc159e3f325da95297067a26d5e3022989be6da
MD5 76b2f556db8b179a1750f1fa3437799d
BLAKE2b-256 a3a467bd68933c6060023a4643ff0cdaf18cff801287ad0ea34b242a106a7b72

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for zyxdb-0.1.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 7d16969d66ba03f7af5b0053033a45bc24add28ffefbd740351eaed3aca2504c
MD5 4108437a16d10ee6edb8f02aa186f15c
BLAKE2b-256 1b545553c9213c70e465133946d9dba048374962086eb9f99fdfdde7b031e81c

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp310-cp310-macosx_13_0_arm64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: zyxdb-0.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zyxdb-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 abb885a0f193e81a7f1f9bc34ea02b8683a089b6e665ee9b618f3e066b841fdd
MD5 43989dbd83c6554df87bea6940adb07e
BLAKE2b-256 931b30e138bb132ac1018494ae4fc431f29f60c9822781a8a584146f52476494

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp39-cp39-win_amd64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for zyxdb-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b1358c5a63eba7f0d1bed7d272450b754a762673613685f189116aa239cbbb85
MD5 d8402d26da369fa86193f098b5791770
BLAKE2b-256 160bb2f3dd9fce8b69f1cb12ad6e2531c7d94c00c2a4000783276a59531030f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zyxdb-0.1.0-cp39-cp39-macosx_13_0_arm64.whl.

File metadata

  • Download URL: zyxdb-0.1.0-cp39-cp39-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.9, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zyxdb-0.1.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 cf6b3782142cb73e2e568c13fe8907d0bd3067ce8d437f671c0752c29f618723
MD5 7b4e46468a85887f2d2711af7043af0b
BLAKE2b-256 370685a4b990103bab79d523dc9719ee6799a86a533e34df9f95be37797a3ada

See more details on using hashes here.

Provenance

The following attestation bundles were made for zyxdb-0.1.0-cp39-cp39-macosx_13_0_arm64.whl:

Publisher: python-bindings.yml on nexepic/zyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page