Nexo Client SDK
High-performance Python client for Nexo.
Quick Start
Run server
docker run -p 7654:7654 emanuelepifani/nexo:latest
This exposes:
- Port 7654 (TCP): Main server socket for SDK clients.
Install SDK
uv add nexo-client
Or with pip:
pip install nexo-client
Connection
from nexo import NexoClient
client = await NexoClient.connect(host="localhost", port=7654)
1. STORE
# Set key
await client.store.map.set("user:1", {"name": "Max", "role": "admin"})
# Get key
user: User | None = await client.store.map.get("user:1")
# Delete key
await client.store.map.delete("user:1")
2. QUEUE
# Create queue
mail_q: NexoQueue[Email] = await client.queue("emails").create()
# Push message
await mail_q.push({"to": "test@test.com"})
# Subscribe
async def handle_email(msg: Email) -> None:
print(msg)
await mail_q.subscribe(handle_email)
# Delete queue
await mail_q.delete()
3. PUB/SUB
# Define topic (no need to create, auto-created on first publish)
alerts: NexoTopic[Alert] = client.pubsub("system-alerts")
# Subscribe
async def on_alert(msg: Alert) -> None:
print(msg)
await alerts.subscribe(on_alert)
# Publish
await alerts.publish({"level": "high"})
4. STREAM
# Create topic
stream: NexoStream[UserEvent] = await client.stream("user-events").create()
# Publisher
await stream.publish({"type": "login", "userId": "u1"})
# Consumer (must specify group)
async def on_event(msg: UserEvent, meta: StreamMessageMeta) -> None:
print(f"User {msg['userId']} performed {msg['type']}")
await stream.subscribe("analytics", on_event)
# Delete topic
await stream.delete()
Callbacks for Queue, Pub/Sub, and Stream can be sync
defor asyncasync def— the SDK handles both.
Binary Payloads
All Nexo brokers (Store, Queue, Stream, PubSub) natively support raw binary data (bytes).
Bypassing JSON serialization drastically reduces Latency, increases Throughput, and saves Bandwidth.
Perfect for: Video chunks, Images, Protobuf/MsgPack, Encrypted blobs.
# Send 1MB raw bytes (30% smaller than JSON/Base64)
heavy_payload = b"\x00" * (1024 * 1024)
# 1. STREAM
stream: NexoStream[bytes] = client.stream("cctv-archive")
await stream.publish(heavy_payload)
# 2. PUBSUB
audio_topic: NexoTopic[bytes] = client.pubsub("live-audio-call")
audio_topic.publish(heavy_payload)
# 3. STORE
await client.store.map.set("user:avatar:1", heavy_payload)
# 4. QUEUE
queue: NexoQueue[bytes] = client.queue("pdf-processing")
await queue.push(heavy_payload)
License
MIT
Links
- Full Documentation: Nexo Docs
- Docker Image: emanuelepifani/nexo
- PyPI: nexo-client
Author
Built by Emanuel Epifani.
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 nexo_client-5.0.0.tar.gz.
File metadata
- Download URL: nexo_client-5.0.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5f1e181698dea5a9543b9b7bc152098064e9371cda74023bf7579d2ac3d7771
|
|
| MD5 |
eb17f3c29747c5e61c758c89a0c6cc6e
|
|
| BLAKE2b-256 |
51d2dd8116959a7035ec7ae8df127d0310074f1c407c5bf05abb0c93e8077355
|
Provenance
The following attestation bundles were made for nexo_client-5.0.0.tar.gz:
Publisher:
release.yml on emanuel-epifani/nexo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nexo_client-5.0.0.tar.gz -
Subject digest:
c5f1e181698dea5a9543b9b7bc152098064e9371cda74023bf7579d2ac3d7771 - Sigstore transparency entry: 2260969448
- Sigstore integration time:
-
Permalink:
emanuel-epifani/nexo@d09ea6657e64dd0f8a6d1390467df66d4c217b5a -
Branch / Tag:
refs/tags/v5.0.0 - Owner: https://github.com/emanuel-epifani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d09ea6657e64dd0f8a6d1390467df66d4c217b5a -
Trigger Event:
push
-
Statement type:
File details
Details for the file nexo_client-5.0.0-py3-none-any.whl.
File metadata
- Download URL: nexo_client-5.0.0-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3385640fe2990907416ea6c1350cc7b5664f887021e15387470133f04b7688a4
|
|
| MD5 |
0e9cf866c1bb0d6692366d96e271c221
|
|
| BLAKE2b-256 |
1f7f591e3ac9f6ad89b071fa7e55ce7fbe65cabc592719972f1f91226fdbd04d
|
Provenance
The following attestation bundles were made for nexo_client-5.0.0-py3-none-any.whl:
Publisher:
release.yml on emanuel-epifani/nexo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nexo_client-5.0.0-py3-none-any.whl -
Subject digest:
3385640fe2990907416ea6c1350cc7b5664f887021e15387470133f04b7688a4 - Sigstore transparency entry: 2260969610
- Sigstore integration time:
-
Permalink:
emanuel-epifani/nexo@d09ea6657e64dd0f8a6d1390467df66d4c217b5a -
Branch / Tag:
refs/tags/v5.0.0 - Owner: https://github.com/emanuel-epifani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d09ea6657e64dd0f8a6d1390467df66d4c217b5a -
Trigger Event:
push
-
Statement type: