sutradb
Python client for SutraDB — an RDF-star triplestore with native HNSW vector indexing.
Installation
pip install sutradb
Quick Start
from sutradb import SutraClient
client = SutraClient("http://localhost:3030")
# Check server health
if client.health():
print("SutraDB is running")
# Run a SPARQL query
results = client.sparql("""
SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10
""")
for binding in results["results"]["bindings"]:
print(binding["s"]["value"], binding["p"]["value"], binding["o"]["value"])
# Insert triples
client.insert_triples("""
<http://example.org/paper/1> <http://example.org/title> "Attention Is All You Need" .
<http://example.org/paper/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Paper> .
""")
# Declare a vector predicate
client.declare_vector(
predicate="http://example.org/hasEmbedding",
dimensions=1536,
)
# Insert a vector
client.insert_vector(
predicate="http://example.org/hasEmbedding",
subject="http://example.org/paper/1",
vector=[0.23, -0.11, 0.87, ...], # 1536-dimensional vector
)
# Batch insert vectors
entries = [
("http://example.org/paper/1", [0.23, -0.11, ...]),
("http://example.org/paper/2", [0.45, 0.02, ...]),
]
result = client.insert_vectors_batch("http://example.org/hasEmbedding", entries)
print(f"Inserted {result['inserted']} vectors")
License
Apache-2.0
Metadata
Release files for sutradb 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sutradb-0.4.0.tar.gz | 10.8 kB | With provenance | Details for sutradb-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sutradb-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for sutradb-0.4.0-py3-none-any.whl |
Total release size: 22.2 kB
Release files / sutradb-0.4.0.tar.gz
| Download URL | sutradb-0.4.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a0c322b9304a999b71d17ad31414614cf29d25af705f8413b34b8d11874c297
|
|
BLAKE2b-256 checksum How to use checksums |
6e6ed8da4b16d9bfb4f94851cd40bf2d7d49fcc758edac6fc0c971e0be821c41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 9, 2026.
Transparency logRelease files / sutradb-0.4.0-py3-none-any.whl
| Download URL | sutradb-0.4.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b2cc2762b32ab1ef4a13fd38817e66f10b274822d4a66b7b1fcf077b77b96c4
|
|
BLAKE2b-256 checksum How to use checksums |
d9f84d71e1c13185deeda3c03f50a9d6447748ca362122f0a6443cf2971570a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 9, 2026.
Transparency logSecurity for sutradb 0.4.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sutradb-0.4.0.tar.gz
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 May 9, 2026.
Transparency logA 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.