Skip to main content

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 def or async async 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

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

nexo_client-4.1.4.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

nexo_client-4.1.4-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file nexo_client-4.1.4.tar.gz.

File metadata

  • Download URL: nexo_client-4.1.4.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for nexo_client-4.1.4.tar.gz
Algorithm Hash digest
SHA256 37c20b6a1957d40604846a73864198f9dca3dec962a2a8e57e4e145f91785159
MD5 faa418e443ab767771d0b1bc3516e8d3
BLAKE2b-256 90dbe1943b3cb3f2d39655f878a7a71ca879879e13b5afb51d97cc28aa63eaf2

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexo_client-4.1.4.tar.gz:

Publisher: release.yml on emanuel-epifani/nexo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexo_client-4.1.4-py3-none-any.whl.

File metadata

  • Download URL: nexo_client-4.1.4-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for nexo_client-4.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f9dd6e5186626fc1315b24ea56807bc89600a30899a1af2b9053fa6c257cce5a
MD5 ff0b2895cde5e18151b4166ee2545d57
BLAKE2b-256 2078a4d207861138effa9d12da98906050d45a075f337d873e16f14a5519a0d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexo_client-4.1.4-py3-none-any.whl:

Publisher: release.yml on emanuel-epifani/nexo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

5.0.3

2 files

5.0.2

2 files

5.0.1

2 files

5.0.0

2 files

4.1.5

2 files

This release

4.1.4 This release

2 files

4.1.3

2 files

4.1.2

2 files

4.1.1

2 files

4.1.0

2 files

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