Python SDK for Meshpocalypse Semantic mesh — NATS + RDF + ATF
Project description
meshpocalypse-semantic — Python SDK
Python SDK for the Meshpocalypse Semantic mesh layer.
Provides async Python access to:
- NATS messaging via
MeshNodeasync context manager - SPARQL queries against the mesh RDF graph via
SparqlClient - ATF trust checks via
ATFClient
Install
pip install meshpocalypse-semantic
Quick Start
import asyncio
from meshpocalypse_semantic import MeshNode, ATFLevel
async def main():
async with MeshNode("nats://localhost:4222") as mesh:
# Publish a message
await mesh.publish("mesh.events.my-agent", b"hello mesh")
# Run a SPARQL query
rows = await mesh.sparql.query(
"SELECT ?agent WHERE { ?agent a <https://meshpocalypse.dev/ontology#Agent> }"
)
for row in rows:
print(row["agent"]["value"])
# Check ATF trust level
level = await mesh.atf.get_trust_level("did:mesh:my-agent")
if level >= ATFLevel.SENIOR:
print("Agent has operational access")
asyncio.run(main())
Requirements
- Python ≥ 3.10
- NATS server running (e.g.
docker run -p 4222:4222 nats:latest) nats-py >= 2.8.0,rdflib >= 7.0,protobuf >= 4.0
Development
cd python-sdk
pip install -e ".[dev]"
pytest
Notes
- BYOK: Bring your own NATS URL and LLM API keys — the SDK does not manage credentials.
MeshNodemust be used as anasync withcontext manager; calling methods outside raisesRuntimeError.SparqlClientrequires a running Meshpocalypse SPARQL bridge on the NATS subjectmesh.sparql.query.ATFClientrequires the TypeScript ATF service onmesh.atf.trust.check.
See docs/integrations/python.md for the full usage guide.
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 Distribution
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 meshpocalypse-1.2.1.tar.gz.
File metadata
- Download URL: meshpocalypse-1.2.1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7d65e09b3b6d798cc10c1394f79d0ffdc8dd2f733d6e0202f5853b8918b83cf
|
|
| MD5 |
0b91f7dc181b9620557fe7803a6bda9a
|
|
| BLAKE2b-256 |
f6352aec732edd0222084c2677e28cf3f191151791b42a07ca7118553eca3e5b
|
Provenance
The following attestation bundles were made for meshpocalypse-1.2.1.tar.gz:
Publisher:
publish-python.yml on one137th/Meshpocalypse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshpocalypse-1.2.1.tar.gz -
Subject digest:
e7d65e09b3b6d798cc10c1394f79d0ffdc8dd2f733d6e0202f5853b8918b83cf - Sigstore transparency entry: 1088246629
- Sigstore integration time:
-
Permalink:
one137th/Meshpocalypse@68dc2b01267c4764be790b32cc375933bcd2896b -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/one137th
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@68dc2b01267c4764be790b32cc375933bcd2896b -
Trigger Event:
push
-
Statement type:
File details
Details for the file meshpocalypse-1.2.1-py3-none-any.whl.
File metadata
- Download URL: meshpocalypse-1.2.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ca9f3d612deba35c38e6517a0c40baa5e920f2cee98aa73522da5669d04e0f8
|
|
| MD5 |
583a5fd8ec07397fb3f6caa023375459
|
|
| BLAKE2b-256 |
10621f14d87a23becbcbeb14fb2c8ee529e76595a7b3ebbf9b3190c0f63321b6
|
Provenance
The following attestation bundles were made for meshpocalypse-1.2.1-py3-none-any.whl:
Publisher:
publish-python.yml on one137th/Meshpocalypse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshpocalypse-1.2.1-py3-none-any.whl -
Subject digest:
7ca9f3d612deba35c38e6517a0c40baa5e920f2cee98aa73522da5669d04e0f8 - Sigstore transparency entry: 1088246792
- Sigstore integration time:
-
Permalink:
one137th/Meshpocalypse@68dc2b01267c4764be790b32cc375933bcd2896b -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/one137th
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@68dc2b01267c4764be790b32cc375933bcd2896b -
Trigger Event:
push
-
Statement type: