Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_transport_udp Discord

Swarmauri UDP Transport

Transport Icon Casts Lifecycle

The Swarmauri UDP Transport provides a datagram-oriented transport with unicast, broadcast, multicast, and anycast semantics. It plugs into the unified transport lifecycle to guarantee capability-safe server and client contexts.

Installation

Using uv

uv add --directory pkgs/standards/swarmauri_transport_udp swarmauri_transport_udp

Using pip

pip install swarmauri_transport_udp

Usage

Below is a simple example that sends a message to a UDP server, which then rebroadcasts the payload.

import asyncio
from swarmauri_transport_udp import UdpTransport

async def main():
    server = UdpTransport(bind="0.0.0.0:5000", multicast_groups=["239.1.2.3"])

    async def run_server():
        async with server.server():
            message = await server.recv()
            await server.broadcast(b"broadcast:" + message)
            await server.multicast(["239.1.2.3:5000"], b"multicast:" + message)

    async def run_client():
        client = UdpTransport()
        async with client.client():
            await client.send("127.0.0.1:5000", b"udp-ping")
            reply = await client.recv()
            print(reply.decode())

    await asyncio.gather(run_server(), run_client())

asyncio.run(main())

Adjust the bind address and multicast groups to suit your environment. The transport leaves socket configuration open so you can customize TTL, reuse, and other behaviors as needed.

Metadata

Release files for swarmauri_transport_udp 0.11.0.dev1

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

Source distribution (sdist)

Source distribution for swarmauri_transport_udp 0.11.0.dev1
File Size Uploaded
swarmauri_transport_udp-0.11.0.dev1.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_transport_udp 0.11.0.dev1
File Interpreter ABI Platform
swarmauri_transport_udp-0.11.0.dev1-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / swarmauri_transport_udp-0.11.0.dev1.tar.gz

Download URL swarmauri_transport_udp-0.11.0.dev1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f5fd118a148c83e7b531522a1f774404a1c3fe6dbbb7d4fdf857fe90c3abda36
BLAKE2b-256 checksum
How to use checksums
fea8296de02cd043fb883aa2d2f3abe1d64bf375bdcb0415bc2d863d299ec5d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / swarmauri_transport_udp-0.11.0.dev1-py3-none-any.whl

Download URL swarmauri_transport_udp-0.11.0.dev1-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67a120898a49b721d05236afc93d5d0e6257ab780651623759e944ff1258a949
BLAKE2b-256 checksum
How to use checksums
df727655e1da7a37a158de932dd0b063b3e3e0998b6028b4820613bf9a73b08a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
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