Python bindings for the Lora in-memory graph database
Project description
lora-python
Python bindings for the Lora in-memory graph
engine. Ships both a synchronous PyO3 Database class and an
asyncio-compatible AsyncDatabase wrapper that never blocks the event loop.
Status: prototype / feasibility check. Not published to PyPI.
Install (local dev)
cd crates/lora-python
python3 -m venv .venv && source .venv/bin/activate
pip install -U pip maturin pytest pytest-asyncio
maturin develop # builds the Rust extension into the venv
pytest # runs the sync + async smoke tests
maturin develop produces a lora_python/_native.<platform>.so inside the
package and makes import lora_python work immediately.
Sync usage
from lora_python import Database, is_node
db = Database.create()
db.execute("CREATE (:Person {name: $n, age: $a})", {"n": "Alice", "a": 30})
res = db.execute("MATCH (n:Person) RETURN n")
for row in res["rows"]:
n = row["n"]
if is_node(n):
print(n["properties"]["name"])
Async usage (non-blocking)
import asyncio
from lora_python import AsyncDatabase
async def main():
db = await AsyncDatabase.create()
await db.execute("CREATE (:Person {name: 'Alice'})")
r = await db.execute("MATCH (n:Person) RETURN n.name AS name")
print(r["rows"])
asyncio.run(main())
AsyncDatabase.execute dispatches the query onto the default asyncio
thread pool via asyncio.to_thread. The PyO3 Database.execute releases
the Python GIL for the duration of engine work, so other coroutines on the
event loop can progress while a query runs. A dedicated test proves the
event loop continues ticking during a 2 000-node MATCH.
Typed value model
Same conceptual contract as lora-node / lora-wasm:
| Python shape | Lora value |
|---|---|
None, bool, int, float, str |
scalars |
list, dict |
collections |
{"kind": "node", "id", "labels", "properties"} |
node |
{"kind": "relationship", "id", …} |
relationship |
{"kind": "path", "nodes": [...], "rels": [...]} |
path |
{"kind": "date", "iso": "YYYY-MM-DD"} (and time, …) |
temporal |
| point dicts — see below | point |
Points are returned as dicts keyed on their CRS:
| SRID | Dict |
|---|---|
| 7203 | {"kind": "point", "srid": 7203, "crs": "cartesian", "x", "y"} |
| 9157 | {"kind": "point", "srid": 9157, "crs": "cartesian-3D", "x", "y", "z"} |
| 4326 | {"kind": "point", "srid": 4326, "crs": "WGS-84-2D", "x", "y", "longitude", "latitude"} |
| 4979 | {"kind": "point", "srid": 4979, "crs": "WGS-84-3D", "x", "y", "z", "longitude", "latitude", "height"} |
Constructors and guards are exported from lora_python.types:
date, time, localtime, datetime, localdatetime, duration,
cartesian, cartesian_3d, wgs84, wgs84_3d, is_node,
is_relationship, is_path, is_point, is_temporal.
distance()on WGS-84-3D points ignoresheight— see functions reference for the full spatial reference and known limitations.
Errors
LoraError— base classLoraQueryError— parse / analyze / execute failureInvalidParamsError— a parameter value couldn't be mapped
All three are available as lora_python.LoraError, etc.
Architecture
lora-database (Rust)
└── lora-python (crate, cdylib) <- PyO3 bindings
├── Database (sync, releases the GIL)
└── python/lora_python/
├── _async.py AsyncDatabase via asyncio.to_thread
└── types.py typed dicts + constructors + guards
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lora_python-0.3.0.tar.gz.
File metadata
- Download URL: lora_python-0.3.0.tar.gz
- Upload date:
- Size: 289.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e21004b847f2f335d5037788a6510d442da1c3f9c57de187f204d0a855ecab7d
|
|
| MD5 |
4a7be3751a4db94b9e36a878267dc448
|
|
| BLAKE2b-256 |
4fcda9b835f0cd17fa3eb0bd8b0074c7585c11b477c314a68380359661525fff
|
Provenance
The following attestation bundles were made for lora_python-0.3.0.tar.gz:
Publisher:
packages-release.yml on lora-db/lora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lora_python-0.3.0.tar.gz -
Subject digest:
e21004b847f2f335d5037788a6510d442da1c3f9c57de187f204d0a855ecab7d - Sigstore transparency entry: 1373965151
- Sigstore integration time:
-
Permalink:
lora-db/lora@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/lora-db
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
packages-release.yml@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lora_python-0.3.0-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: lora_python-0.3.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd0f10360be75382ff65898d33c295cffeae035babcd6776c7488e1dcc6bd0d6
|
|
| MD5 |
a52466ae91a7a650c009e7b5c6c6f2b8
|
|
| BLAKE2b-256 |
57f5a4483ff74361f8773b0a3933cb445542c1444df004e5942c004b1a96e7a6
|
Provenance
The following attestation bundles were made for lora_python-0.3.0-cp38-abi3-win_amd64.whl:
Publisher:
packages-release.yml on lora-db/lora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lora_python-0.3.0-cp38-abi3-win_amd64.whl -
Subject digest:
fd0f10360be75382ff65898d33c295cffeae035babcd6776c7488e1dcc6bd0d6 - Sigstore transparency entry: 1373965335
- Sigstore integration time:
-
Permalink:
lora-db/lora@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/lora-db
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
packages-release.yml@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lora_python-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: lora_python-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a30d52e9f2fb0ee19054218924626563be6304caaaa86629dab8568ffb8dd7f1
|
|
| MD5 |
4d0be833982d4525079816f4c1fde2c2
|
|
| BLAKE2b-256 |
e94cf7f3489cf6a81c9c510f4ae8998af0e56cdbc1d719ef5236f350243c7e9a
|
Provenance
The following attestation bundles were made for lora_python-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
packages-release.yml on lora-db/lora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lora_python-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
a30d52e9f2fb0ee19054218924626563be6304caaaa86629dab8568ffb8dd7f1 - Sigstore transparency entry: 1373965432
- Sigstore integration time:
-
Permalink:
lora-db/lora@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/lora-db
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
packages-release.yml@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lora_python-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: lora_python-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d2d9d30a00a3fe185fc209d66da85f0e70ef63018ad92dcadbc845c8863a178
|
|
| MD5 |
54bfc6cf7d0f9401672d44ae979817be
|
|
| BLAKE2b-256 |
b642d102e8e6d4a34fccb01536b9109af12d4cb08394bd81fa90790303c798a9
|
Provenance
The following attestation bundles were made for lora_python-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
packages-release.yml on lora-db/lora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lora_python-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
4d2d9d30a00a3fe185fc209d66da85f0e70ef63018ad92dcadbc845c8863a178 - Sigstore transparency entry: 1373965233
- Sigstore integration time:
-
Permalink:
lora-db/lora@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/lora-db
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
packages-release.yml@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lora_python-0.3.0-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: lora_python-0.3.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edc89706c69bde7cb505d99acfcf00a634dadff1e55ba45cdbb52f27bb5db141
|
|
| MD5 |
99ef93a8f8934cb965e5e96bd3d0f794
|
|
| BLAKE2b-256 |
d7afdda4dae4de7829a7cae1e7d06dc6e61709c8521234570987bf31c21559e4
|
Provenance
The following attestation bundles were made for lora_python-0.3.0-cp38-abi3-macosx_11_0_arm64.whl:
Publisher:
packages-release.yml on lora-db/lora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lora_python-0.3.0-cp38-abi3-macosx_11_0_arm64.whl -
Subject digest:
edc89706c69bde7cb505d99acfcf00a634dadff1e55ba45cdbb52f27bb5db141 - Sigstore transparency entry: 1373965641
- Sigstore integration time:
-
Permalink:
lora-db/lora@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/lora-db
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
packages-release.yml@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lora_python-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: lora_python-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c5c48c53160a6576c45bc903cfbb8e6fe7fa297119a448561e7e5a3aaeff693
|
|
| MD5 |
5986dfdfbc26f1c3e8f22561bdca66cf
|
|
| BLAKE2b-256 |
97cc997836554e191d4243709cb6738810bc7c5e707f331b1ed00bce6563a7a6
|
Provenance
The following attestation bundles were made for lora_python-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl:
Publisher:
packages-release.yml on lora-db/lora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lora_python-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl -
Subject digest:
6c5c48c53160a6576c45bc903cfbb8e6fe7fa297119a448561e7e5a3aaeff693 - Sigstore transparency entry: 1373965560
- Sigstore integration time:
-
Permalink:
lora-db/lora@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/lora-db
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
packages-release.yml@49110c962fc81a9d8b0360be6d10bd9bbe7457c2 -
Trigger Event:
push
-
Statement type: