skillfed

asyncio-dgram

Higher level Datagram support for Asyncio

asyncio-dgram v3.0.0 184.4K downloads/30d#10,040 on PyPI56
Permissive license MIT Active released

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-dgram

uv

uv add asyncio-dgram

poetry

poetry add asyncio-dgram

Installing 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

Development Status :: 5 - Production/StableFramework :: AsyncIOIntended Audience :: DevelopersProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

async udp datagramasyncio datagram supportawait read udpasync datagram client serverasyncio dgram wrapperudp async awaitdatagram asyncio
async-networkingudp

More Networking packages