Skip to main content

samyama — Python SDK for the Samyama Graph Database

Python bindings for Samyama, a property-graph database with a Cypher query engine. The extension module is built from Rust with PyO3 on top of crates/samyama-sdk, so the embedded mode runs the engine in-process — no server, no network.

Install

pip install samyama

Wheels are abi3 and work on CPython 3.8+.

The package also installs samyama_aio (asyncio wrapper), samyama_nb (notebook helpers) and samyama_mcp (an MCP server, entry point samyama-mcp-serve).

Connect

Two modes. Embedded runs the engine inside your process:

from samyama import SamyamaClient

client = SamyamaClient.embedded()

Remote talks to a running Samyama server over HTTP:

from samyama import SamyamaClient

client = SamyamaClient.connect(
    "http://localhost:8080",
    timeout_seconds=30.0,          # whole-request deadline
    connect_timeout_seconds=5.0,   # TCP connect only
    max_retries=2,
    retry_base_delay_ms=100,
)

Both return the same SamyamaClient, with the same query methods. Graph algorithms (page_rank, wcc, scc, bfs, dijkstra, pca, triangle_count) and the vector methods (create_vector_index, add_vector, vector_search) are embedded-only and raise RuntimeError on a remote client.

First query

from samyama import SamyamaClient

client = SamyamaClient.embedded()

client.query('CREATE (:Person {name: "Alice"})-[:KNOWS]->(:Person {name: "Bob"})')

result = client.query_readonly(
    "MATCH (a:Person)-[:KNOWS]->(b:Person) RETURN a.name, b.name"
)

print(result.columns)   # ['a.name', 'b.name']
for row in result.records:
    print(row)          # ['Alice', 'Bob']
print(len(result))      # 1

query is read-write, query_readonly is read-only. Both take an optional graph argument, which defaults to "default"; this build serves a single graph and rejects any other name.

A QueryResult exposes columns, records, nodes, edges, and len().

Other methods on the client: status() (returns a ServerStatus with status, version, nodes, edges), ping(), list_graphs(), delete_graph(graph="default").

asyncio

samyama_aio wraps the same client, running each call on a worker thread so the event loop is not blocked:

import asyncio
from samyama_aio import AsyncSamyamaClient

async def main():
    client = await AsyncSamyamaClient.embedded()
    await client.query('CREATE (:Person {name: "Alice"})')
    result = await client.query_readonly("MATCH (n:Person) RETURN n.name")
    print(result.records)   # [['Alice']]

asyncio.run(main())

AsyncSamyamaClient.connect(url, **kwargs) takes the same keyword arguments as SamyamaClient.connect.

More

Apache-2.0.

Metadata

Release files for samyama 1.10.0

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

Source distribution (sdist)

Source distribution for samyama 1.10.0
File Size Uploaded
samyama-1.10.0.tar.gz 5.9 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for samyama 1.10.0
File
samyama-1.10.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
samyama-1.10.0-cp38-abi3-manylinux_2_28_x86_64.whl CPython 3.8 abi3 Linux glibc 2.28+ x86-64 Details
samyama-1.10.0-cp38-abi3-manylinux_2_28_aarch64.whl CPython 3.8 abi3 Linux glibc 2.28+ ARM64 Details
samyama-1.10.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details

Total release size: 41.1 MB

Release files / samyama-1.10.0.tar.gz

Download URL samyama-1.10.0.tar.gz
Size 5.9 MB
Tags Source
SHA-256 checksum
How to use checksums
cf8d65f9c85317d6210c360bdd985dbd7fcee6868f7a9ce2a0ad501aac87cbd4
BLAKE2b-256 checksum
How to use checksums
bfbf29fde84dc29efe1877c0464b5b44f6ac583d1e9a9fcdd3e65c95c9a6ff5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / samyama-1.10.0-cp38-abi3-win_amd64.whl

Download URL samyama-1.10.0-cp38-abi3-win_amd64.whl
Size 7.9 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e27aef941a6e794c740dfeea96a4a00c985a5d0ac4d5913e3d870355d898d75d
BLAKE2b-256 checksum
How to use checksums
e3e5d2c0145c440441bedcdfe39a7d8420bc0b944d53676543fec7e4586c6e66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / samyama-1.10.0-cp38-abi3-manylinux_2_28_x86_64.whl

Download URL samyama-1.10.0-cp38-abi3-manylinux_2_28_x86_64.whl
Size 9.8 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
0a329ae31c9cb339bfbbb9ebc6c2c4ba6248f39b23ace25f745edc131f60ab81
BLAKE2b-256 checksum
How to use checksums
f1f9e64b375c3b357e0fecb0637c46e5f5ca67c14ac86c526c2eb562edaba36c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / samyama-1.10.0-cp38-abi3-manylinux_2_28_aarch64.whl

Download URL samyama-1.10.0-cp38-abi3-manylinux_2_28_aarch64.whl
Size 9.4 MB
Tags CPython 3.8 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
52851d6d3545d750303891dc9cf0344664e38ea575498a1ebcf9f233b0cbc49d
BLAKE2b-256 checksum
How to use checksums
cf1e49c58fcae606d18f569ba15f501d63ae48a39430df2da1376b4bfe992f0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / samyama-1.10.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL samyama-1.10.0-cp38-abi3-macosx_11_0_arm64.whl
Size 8.2 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d80b24e531addad51db8e9dc3460c21356455a6c7e6cdd6d14206be04b330d67
BLAKE2b-256 checksum
How to use checksums
9c709fe164fe32137ad36816c818b86cf17a9fcca44e7415416b3f0bc5787641
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.10.0 This release

5 release files

1.9.0

6 release files

1.8.0

6 release files

1.7.1

2 release files

0.6.1

2 release files

0.6.0

1 release file

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