Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

grafeo

Python bindings for Grafeo, a high-performance, embeddable graph database with a Rust core.

Installation

uv add grafeo
# or: pip install grafeo

Quick Start

from grafeo import GrafeoDB

# In-memory database
db = GrafeoDB()

# Or persistent
# db = GrafeoDB("./my-graph")

# Create nodes
db.execute("INSERT (:Person {name: 'Alix', age: 30})")
db.execute("INSERT (:Person {name: 'Gus', age: 25})")
db.execute("INSERT (:Person {name: 'Alix'})-[:KNOWS]->(:Person {name: 'Gus'})")

# Query the graph
result = db.execute("MATCH (p:Person) WHERE p.age > 20 RETURN p.name, p.age")
for row in result:
    print(row)

API Overview

Database

db = GrafeoDB()              # in-memory
db = GrafeoDB("./path")      # persistent
db = GrafeoDB.open("./path") # open existing

db.node_count   # number of nodes
db.edge_count   # number of edges

Query Languages

result = db.execute(gql)                        # GQL (ISO standard)
result = db.execute(gql, {"name": "Alix"})     # GQL with parameters
result = db.execute_cypher(query)               # Cypher
result = db.execute_sparql(query)               # SPARQL
result = db.execute_gremlin(query)              # Gremlin
result = db.execute_graphql(query)              # GraphQL
result = db.execute_sql(query)                  # SQL/PGQ (SQL:2023)

Node & Edge CRUD

node = db.create_node(["Person"], {"name": "Alix", "age": 30})
edge = db.create_edge(source_id, target_id, "KNOWS", {"since": 2024})

n = db.get_node(node_id)   # Node or None
e = db.get_edge(edge_id)   # Edge or None

db.set_node_property(node_id, "key", "value")
db.set_edge_property(edge_id, "key", "value")

db.delete_node(node_id)
db.delete_edge(edge_id)

Transactions

# Context manager (auto-rollback on exception)
with db.begin_transaction() as tx:
    tx.execute("INSERT (:Person {name: 'Harm'})")
    tx.commit()

# With isolation levels (string or enum)
from grafeo import IsolationLevel
with db.begin_transaction(IsolationLevel.SERIALIZABLE) as tx:
    tx.execute("MATCH (n:Person) SET n.verified = true")
    tx.commit()

# Per-transaction CDC override
with db.begin_transaction_with_cdc(True) as tx:
    tx.execute("INSERT (:AuditedEvent {action: 'login'})")
    tx.commit()

Named Graphs and Schemas

db.create_graph("social")
db.set_graph("social")
print(db.list_graphs())       # ['social']
print(db.current_graph())     # 'social'
db.reset_graph()
db.drop_graph("social")

db.set_schema("v1")
print(db.current_schema())    # 'v1'
db.reset_schema()

Graph Projections

db.create_projection("people", node_labels=["Person"], edge_types=["KNOWS"])
print(db.list_projections())  # ['people']
db.drop_projection("people")

Data Import

count = db.import_csv("users.csv", "Person", headers=True)
count = db.import_jsonl("events.jsonl", "Event")

Backup and Restore

db.backup_full("/backups/full")
db.backup_incremental("/backups/incr")
GrafeoDB.restore_to_epoch("/backups/full", epoch=100, output_path="./restored")

QueryResult

result = db.execute("MATCH (n:Person) RETURN n.name, n.age")

result.columns          # column names
len(result)             # row count
result.execution_time_ms  # execution time (milliseconds)

for row in result:      # iterate rows
    print(row)

result[0]               # access by index
result.scalar()         # first column of first row
# Create an HNSW index
db.create_vector_index("Document", "embedding", dimensions=384)

# Insert vectors
node = db.create_node(["Document"], {"embedding": [0.1, 0.2, ...]})

# Search
results = db.vector_search("Document", "embedding", query_vector, k=10)

Features

  • GQL, Cypher, SPARQL, Gremlin, GraphQL, and SQL/PGQ query languages
  • Full node/edge CRUD with native Python types
  • ACID transactions with configurable isolation levels
  • HNSW vector similarity search
  • Property indexes for fast lookups
  • Named graph and schema management
  • Graph projections (filtered virtual views)
  • CSV and JSON Lines import
  • Incremental backup and restore
  • Per-transaction CDC control
  • Async support via asyncio
  • Type stubs included

License

Apache-2.0

Metadata

Release files for grafeo 0.6.0b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grafeo 0.6.0b1
File Size Uploaded
grafeo-0.6.0b1.tar.gz 4.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for grafeo 0.6.0b1
File
grafeo-0.6.0b1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
grafeo-0.6.0b1-cp312-abi3-win32.whl CPython 3.12 abi3 Windows x86-32 Details
grafeo-0.6.0b1-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details
grafeo-0.6.0b1-cp312-abi3-musllinux_1_2_aarch64.whl CPython 3.12 abi3 Linux musl 1.2+ ARM64 Details
grafeo-0.6.0b1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details
grafeo-0.6.0b1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details
grafeo-0.6.0b1-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
grafeo-0.6.0b1-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details

Total release size: 54.8 MB

Release files / grafeo-0.6.0b1.tar.gz

Download URL grafeo-0.6.0b1.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
8812a87bb0bf9ebd3049d397169ceebf498639e53fb51c7bfdf41c079ae64186
BLAKE2b-256 checksum
How to use checksums
ae17b91d08ebece62df9efb12afbe07b33d50f645ed5a368f78f28d2356d98d4
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 Oct 11, 2026.

Transparency log

Release files / grafeo-0.6.0b1-cp312-abi3-win_amd64.whl

Download URL grafeo-0.6.0b1-cp312-abi3-win_amd64.whl
Size 6.4 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
6073ebb567e05a486eca9acec2b8adcb271e70dcd76aaf3342614d8eb6f7ccf5
BLAKE2b-256 checksum
How to use checksums
07cf10a7cf4c71bf64d0b259c60f7e27771ff68925c28fe2c4a1749299eea8a6
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 Oct 11, 2026.

Transparency log

Release files / grafeo-0.6.0b1-cp312-abi3-win32.whl

Download URL grafeo-0.6.0b1-cp312-abi3-win32.whl
Size 5.9 MB
Tags CPython 3.12 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
e88a59f4eecf3861886a1b27d1286a3fda9afd2d34f901af00f9d023579912a9
BLAKE2b-256 checksum
How to use checksums
820ac49a4cde17781be02203e2d7684ec8701946d2f22913ed862afb08ff9458
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 Oct 11, 2026.

Transparency log

Release files / grafeo-0.6.0b1-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL grafeo-0.6.0b1-cp312-abi3-musllinux_1_2_x86_64.whl
Size 6.8 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
5887191084b1be6e41a6e778b028060a583f4a722985af70bd6638aacddd2d78
BLAKE2b-256 checksum
How to use checksums
4afb404cb98848b624bd27a1e6ae304b06cae410b78a00747a8f14dda63ed001
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 Oct 11, 2026.

Transparency log

Release files / grafeo-0.6.0b1-cp312-abi3-musllinux_1_2_aarch64.whl

Download URL grafeo-0.6.0b1-cp312-abi3-musllinux_1_2_aarch64.whl
Size 6.4 MB
Tags CPython 3.12 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
a7f22205083afa97dd0f652e5aeadf031714ffd4cc9e1dadd10eaa84307251b2
BLAKE2b-256 checksum
How to use checksums
472776344cae0d89ff31bd1150b6833c83bad746d52aad17d50c94a2ebc551da
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 Oct 11, 2026.

Transparency log

Release files / grafeo-0.6.0b1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL grafeo-0.6.0b1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
3831815292dc132ef2afa41c37c369ebf13e9d3699917698ea4170522d7159fc
BLAKE2b-256 checksum
How to use checksums
0aff1a8ae6b82190c0b9a6d6689d08a9128a3ff45e27f87fd610172cad7f5777
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 Oct 11, 2026.

Transparency log

Release files / grafeo-0.6.0b1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL grafeo-0.6.0b1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.3 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
82ba87d05b70b3fd63f7126eaa29ceae8171de6c568b1a7e213a11f76304e5c7
BLAKE2b-256 checksum
How to use checksums
3beada4366ce18d57e9ef940c02a3cfdb2e6d344391a392e493f026a3e5912fb
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 Oct 11, 2026.

Transparency log

Release files / grafeo-0.6.0b1-cp312-abi3-macosx_11_0_arm64.whl

Download URL grafeo-0.6.0b1-cp312-abi3-macosx_11_0_arm64.whl
Size 5.9 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f978854fcda3830c7f78381e4e107e6b8ad9a2e684a60eb0d47616c932111dce
BLAKE2b-256 checksum
How to use checksums
1fac266e0d89424ee32c936d79df25129974d5c7e8d1f5bbfa352157c1c899ce
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 Oct 11, 2026.

Transparency log

Release files / grafeo-0.6.0b1-cp312-abi3-macosx_10_12_x86_64.whl

Download URL grafeo-0.6.0b1-cp312-abi3-macosx_10_12_x86_64.whl
Size 6.3 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6ded53a38eccd1ab3a8c1544d6a9d79c5e37b94399149f8633321d5676b06b82
BLAKE2b-256 checksum
How to use checksums
cb45575983d525c0e996f31842bb45f49d9b7b72d7509906f854f4e14a31b353
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 Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0b1 This release

9 release files

0.5.43

9 release files

0.5.41

9 release files

0.5.40

9 release files

0.5.39

9 release files

0.5.38

9 release files

0.5.37

9 release files

0.5.36

9 release files

0.5.35

9 release files

0.5.9

23 release files

0.5.8

23 release files

0.5.7

23 release files

0.5.6

23 release files

0.5.5

23 release files

0.5.4

23 release files

0.5.3

23 release files

0.5.1

23 release files

0.5.0

23 release files

0.4.4

23 release files

0.1.4

23 release files

0.1.1

23 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