Skip to main content

froGQL

Embedded GQL graph database with single-file storage. Rust core, Python bindings via PyO3.

froGQL implements ISO GQL path pattern matching: MATCH, comma-joins, unions, repetitions ({n,m}), OPTIONAL MATCH, EXISTS / NOT EXISTS, WHERE, RETURN, LIMIT. The runtime uses Leapfrog Triejoin (CompactLTJ) as its primary join strategy — worst-case-optimal for multi-way joins, with measured 14×–4000× speedups over pairwise hash-join on social-graph workloads.

Install

pip install frogql

Wheels ship for CPython 3.8+ on Linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows (x86_64).

Quick start

import frogql

# Open or create a .gdb database
conn = frogql.open("movies.gdb")

# Run a query — returns a list of {alias: value} dicts.
# Use `AS name` in RETURN to pick the dict key; otherwise the
# projection falls back to col0, col1, ...
rows = conn.execute(
    "MATCH (p:Person)-[:ACTED_IN]->(m:Movie) "
    "WHERE m.released = 1999 "
    "RETURN p.name AS actor, m.title AS title",
    limit=10,
)
for row in rows:
    print(row["actor"], "->", row["title"])

# Inspect the graph
print(conn.node_count, conn.edge_count)
print(conn.schema())

Bare patterns (no RETURN)

A query without RETURN projects each row as a dict of the matched variables plus a special _paths key holding the full match:

rows = conn.execute("(p:Person)-[:ACTED_IN]->(m:Movie)", limit=1)
row = rows[0]
row["p"]        # {"kind": "node", "id": ..., "labels": [...], "props": {...}}
row["m"]        # the movie node
row["_paths"]   # [[node_p, edge, node_m]] — list of paths, each a
                # list of node/edge dicts in match order

_paths is a list because comma-joined patterns produce one path per joined sub-pattern. For a single pattern, _paths[0] is the full path.

Data import

# From JSON
frogql.import_json("graph.gdb", "graph.json")

# From a CSV directory with spanner_import_config.json
frogql.import_csv("graph.gdb", "path/to/csv_dir/")

Graph types and indexes

The catalog persists inside the .gdb file. DDL is plain GQL:

conn.execute("CREATE GRAPH TYPE movies { (:Movie {title STRING, released INT}) }")
conn.execute("USE GRAPH TYPE movies")
conn.execute("VALIDATE GRAPH TYPE movies")
conn.execute("CREATE BTREE INDEX ON :Movie(released)")

A DEFAULT graph type is auto-inferred at import time. Auto-built secondary indexes (hash + btree) cover unique (label, prop) pairs and are picked up by the optimizer for constant-folding and range filters.

API surface

Call Returns
frogql.open(path) Connection
frogql.import_json(db_path, json_path) None
frogql.import_csv(db_path, csv_dir) None
Connection.execute(query, limit=100) list[dict] (with RETURN: keys = aliases or colN; without RETURN: keys = pattern variables plus _paths)
Connection.schema() dict
Connection.graph_types() list[dict]
Connection.node_count / Connection.edge_count int

Connection is not thread-safe across Python threads (PyO3 unsendable).

License

MIT. See LICENSE in the source repository.

Metadata

Release files for frogql 0.2.6

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

Source distribution (sdist)

Source distribution for frogql 0.2.6
File Size Uploaded Provenance Actions
frogql-0.2.6.tar.gz 333.3 kB Without provenance Details for frogql-0.2.6.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for frogql 0.2.6
File Actions
frogql-0.2.6-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for frogql-0.2.6-cp38-abi3-win_amd64.whl
frogql-0.2.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for frogql-0.2.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
frogql-0.2.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for frogql-0.2.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
frogql-0.2.6-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for frogql-0.2.6-cp38-abi3-macosx_11_0_arm64.whl
frogql-0.2.6-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for frogql-0.2.6-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 6.3 MB

Release files / frogql-0.2.6.tar.gz

Download URL frogql-0.2.6.tar.gz
Size 333.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e74d8e4abae1b345ddc613e6fb3d14cd8099c32508e6639ade5e12aab9894360
BLAKE2b-256 checksum
How to use checksums
4359e8364239d6eaa95fa447de315e9edf7588705e40166c19ea04a2ca92fb65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / frogql-0.2.6-cp38-abi3-win_amd64.whl

Download URL frogql-0.2.6-cp38-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7fb15a5d816956366330fe5e0a384c32279243de95421ba5334f45f9194f8e87
BLAKE2b-256 checksum
How to use checksums
eb2e164a5a754ecc4ad3e50f265d1648abb21d1c75f8b02b2f9b3df65157cfad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / frogql-0.2.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL frogql-0.2.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
df17175102dd7849da79360e0c9227973b180ea973c718843343dfb0b6a9416a
BLAKE2b-256 checksum
How to use checksums
96991ac2635188349ef6fe0667ce6d81d4ec728e0b0da78de9f33df32cf74c53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / frogql-0.2.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL frogql-0.2.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.2 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
7a6c43f148a1760021038f58e89588de59445cb4f192a2d9f58d99847ec11864
BLAKE2b-256 checksum
How to use checksums
6e06208cf7496b8a652831c5473f19d8f9a8c9fc13c8392780712f413f36588e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / frogql-0.2.6-cp38-abi3-macosx_11_0_arm64.whl

Download URL frogql-0.2.6-cp38-abi3-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7b55b75b633323f5fd5087eec10cfad10cb5220e1a909ef5e7347d5244ef820d
BLAKE2b-256 checksum
How to use checksums
da3b31763ffb5d9baccb93217f40064002a7408a982a64eb504cf7f2d5441e43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / frogql-0.2.6-cp38-abi3-macosx_10_12_x86_64.whl

Download URL frogql-0.2.6-cp38-abi3-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8140b93ed8877d3b95a96572a77eb3b5b0e6c1b6618efd4180396a0f2de7cc6b
BLAKE2b-256 checksum
How to use checksums
c1b0fca4bfbf3da5e0d42e68646eb70be29e7bf43ea22ab60268033e5cf8c62d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Security for frogql 0.2.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.2.6 This release

6 release files No provenance

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