asyncio-dgram
Higher level Datagram support for Asyncio
What it is and what it does
asyncio-dgram wraps asyncio's lower-level datagram protocol machinery to let you use simple async/await patterns for UDP communication. Instead of subclassing asyncio.DatagramProtocol and implementing callbacks, you call three straightforward functions—connect() for point-to-point communication, bind() for listening to multiple sources, or from_socket() for custom socket setup—then await send() and recv() calls directly.
The package is designed around common UDP patterns and avoids exposing the full complexity of asyncio's create_datagram_endpoint. It has no runtime dependencies, supports Python 3.9 through 3.14, and is actively maintained. The API is opinionated but intentionally simple: you get what most datagram use cases need without the flexibility overhead.
Use it for:
- Building UDP echo servers or clients that need clean async/await syntax instead of protocol callbacks.
- Implementing DNS query clients or other request-response UDP patterns with simple send-and-receive logic.
- Creating lightweight UDP-based monitoring or telemetry collectors that handle multiple remote sources.
- Prototyping or teaching async network programming without the boilerplate of DatagramProtocol subclassing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides simple async/await wrappers for UDP datagram communication, letting you read from and send to datagram endpoints without inheriting from asyncio.DatagramProtocol.
Yes. Low friction, no dependencies, actively maintained, MIT-licensed, and solves a real pain point in asyncio's datagram API. Install it if you need to do UDP communication in an async context and want to avoid writing boilerplate protocol classes.
Install
asyncio-dgram on PyPI
pip
pip install asyncio-dgramuv
uv add asyncio-dgrampoetry
poetry add asyncio-dgramInstalling asyncio-dgram
Before you install
Low install friction; no runtime dependencies. Actively maintained with recent releases and a stable codebase.
License in practice
MIT license permits commercial and private use with minimal restrictions.
Quickstart
import asyncio
import asyncio_dgram
async def example():
stream = await asyncio_dgram.connect(("127.0.0.1", 8888))
await stream.send(b"Hello")
data, addr = await stream.recv()
stream.close()
asyncio.run(example())
Requires Python 3.9 or later.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 205 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 184,364/month — #10,040 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: asyncio_dgram-3.0.0-py3-none-any.whl
Keywords: asyncio, datagram, udp
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
pyserial-asyncioAdds async/await support to pyserial for…
permissive · top 15,000 on PyPI
aiorunProvides a simplified entry point for asyncio…
permissive · top 15,000 on PyPI
python3-dtlsAdds DTLS (Datagram Transport Layer Security)…
permissive · top 15,000 on PyPI
devo-sdkSend events and files to Devo, query data via…
permissive · top 15,000 on PyPI
aiofastnetaiofastnet replaces asyncio's transport and…
unclear · top 15,000 on PyPI
directvAsynchronous Python client for controlling and…
permissive · top 15,000 on PyPI
synchronicityWraps async functions, generators, and classes…
permissive · top 1,000 on PyPI
nest-asyncioPatches asyncio to allow nested event loops,…
permissive · top 1,000 on PyPI
aiosmtplibaiosmtplib is an asynchronous SMTP client that…
permissive · top 5,000 on PyPI
aioserialProvides async/await serial port I/O using…
copyleft · top 15,000 on PyPI