Skip to main content

AI-native, bitemporal ledger database with MVCC, SQL, and LSM storage

Project description

tensordb

Python bindings for TensorDB — an AI-native, bitemporal ledger database with MVCC, SQL, and LSM storage.

Install

pip install tensordb

Quick Start

from tensordb 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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

tensordb-0.2.3-cp313-cp313-manylinux_2_38_aarch64.whl (3.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.38+ ARM64

tensordb-0.2.3-cp313-cp313-manylinux_2_34_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

File details

Details for the file tensordb-0.2.3-cp313-cp313-manylinux_2_38_aarch64.whl.

File metadata

File hashes

Hashes for tensordb-0.2.3-cp313-cp313-manylinux_2_38_aarch64.whl
Algorithm Hash digest
SHA256 48c7d9bf33dd0b9290d65fedccced0a32672238a9e1b5c51ab0c40ef1cf5c089
MD5 eba897b41dd7630956ea865a20d2c85c
BLAKE2b-256 39b866d3f10a3a9f0b2a415f4fe89cd769e4af445cf761f76b7d75974b356fd2

See more details on using hashes here.

File details

Details for the file tensordb-0.2.3-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for tensordb-0.2.3-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 24a558fba2d3cfa7619c3fd57473b770751d68a50720ce2944bb64f34e9c3f8f
MD5 aaafc426696b44e772e7865cd046bee8
BLAKE2b-256 945a640f97e7215c29a786697148ab9c9c85abbd1de6bdca3c7c523738594f22

See more details on using hashes here.

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