AI-native, bitemporal ledger database with MVCC, SQL, and LSM storage
Project description
spectradb
Python bindings for SpectraDB — an AI-native, bitemporal ledger database with MVCC, SQL, and LSM storage.
Install
pip install spectradb
Quick Start
from spectradb import PyDatabase
import json
# Open (or create) a database
db = PyDatabase.open("/tmp/mydb")
# Insert a document
doc = json.dumps({"name": "Alice", "age": 30}).encode()
db.put(b"user:1", doc, 0, 2**63 - 1)
# Point read
data = db.get(b"user:1")
print(json.loads(data)) # {'name': 'Alice', 'age': 30}
# SQL query
db.sql("CREATE TABLE users (id INT, name TEXT, age INT)")
db.sql("INSERT INTO users VALUES (1, 'Alice', 30)")
rows = db.sql("SELECT * FROM users WHERE age > 25")
print(rows)
API
PyDatabase.open(path, shard_count=None)
Open or create a database at path.
db.put(key, doc, valid_from, valid_to)
Insert a document. Returns the commit timestamp.
db.get(key, as_of=None, valid_at=None)
Read a document by key. Supports bitemporal queries.
db.sql(query)
Execute a SQL statement. Returns rows or affected-row metadata.
License
PolyForm Noncommercial 1.0.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
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 spectradb_engine-0.1.0-cp313-cp313-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: spectradb_engine-0.1.0-cp313-cp313-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.13, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad0745f25410c19ceda6b72ed2197dbd2d13016319caa59708ddbeaee0db0646
|
|
| MD5 |
3ecdbe61f191a39e8f50991e0bdc6bc9
|
|
| BLAKE2b-256 |
93d4483d20669b0149976a87319082240ac8297484ccf91c2fee62620cf2a15c
|