{"id":16168568,"url":"https://github.com/thatxliner/aioudp","last_synced_at":"2025-07-09T13:35:31.669Z","repository":{"id":45350169,"uuid":"429626760","full_name":"ThatXliner/aioudp","owner":"ThatXliner","description":"A better API for Python asynchronous UDP","archived":false,"fork":false,"pushed_at":"2025-01-01T04:39:53.000Z","size":420,"stargazers_count":18,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T23:19:55.138Z","etag":null,"topics":["async","asyncio","python","python3","udp","udp-client","udp-server"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/aioudp/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThatXliner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-19T00:59:49.000Z","updated_at":"2025-02-07T15:14:25.000Z","dependencies_parsed_at":"2023-12-17T07:20:51.180Z","dependency_job_id":"b18d7ef2-dfa6-47b3-a735-446c0781d33e","html_url":"https://github.com/ThatXliner/aioudp","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"1ef76144d2d86561e50f9e098e593b42d0326df0"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThatXliner%2Faioudp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThatXliner%2Faioudp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThatXliner%2Faioudp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThatXliner%2Faioudp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThatXliner","download_url":"https://codeload.github.com/ThatXliner/aioudp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244325234,"owners_count":20435071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","asyncio","python","python3","udp","udp-client","udp-server"],"created_at":"2024-10-10T03:12:15.564Z","updated_at":"2025-03-18T23:30:59.908Z","avatar_url":"https://github.com/ThatXliner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AioUDP\n\n\u003cpicture\u003e\n  \u003c!-- Dark mode image --\u003e\n  \u003csource srcset=\"docs/assets/Dark-Banner@2x.png\" media=\"(prefers-color-scheme: dark)\"\u003e\n  \u003c!-- Light mode image --\u003e\n  \u003csource srcset=\"docs/assets/Light-Banner@2x.png\" media=\"(prefers-color-scheme: light)\"\u003e\n  \u003c!-- Fallback image --\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/ThatXliner/aioudp/refs/heads/main/docs/assets/Light-Banner%402x.png\" alt=\"AioUDP Banner\" style=\"max-width: 100%; height: auto;\"\u003e\n\u003c/picture\u003e\n\n\u003e A better API for asynchronous UDP\n\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat\u0026labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![codecov](https://codecov.io/gh/ThatXliner/aioudp/branch/main/graph/badge.svg)](https://codecov.io/gh/ThatXliner/aioudp)\n\n[![Documentation Status](https://readthedocs.org/projects/aioudp/badge/?version=latest)](https://aioudp.readthedocs.io/en/latest/?badge=latest)\n[![CI](https://github.com/ThatXliner/aioudp/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/ThatXliner/aioudp/actions/workflows/ci.yml)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aioudp)](https://pypi.org/project/aioudp)\n[![PyPI](https://img.shields.io/pypi/v/aioudp)](https://pypi.org/project/aioudp)\n[![PyPI - License](https://img.shields.io/pypi/l/aioudp)](#license)\n\n\u003e [!NOTE]\n\u003e This repository is *maintained*, but seems stagnant because it is feature-complete. If you find an issue, please [report it](https://github.com/ThatXliner/aioudp/issues?q=sort:updated-desc+is:issue+is:open).\n\nA [websockets](https://websockets.readthedocs.io/en/stable/index.html)-like API for [UDP](https://en.wikipedia.org/wiki/User_Datagram_Protocol)\n\nHere's an example echo server:\n\n```py\nimport asyncio\nimport signal\n\nimport aioudp\n\n\nasync def main():\n    async def handler(connection):\n        async for message in connection:\n            await connection.send(message)\n\n    loop = asyncio.get_running_loop()\n    stop = loop.create_future()\n    # Optional. This is for properly exiting the server when Ctrl-C is pressed\n    # or when the process is killed/terminated\n    loop.add_signal_handler(signal.SIGTERM, stop.set_result, None)\n    loop.add_signal_handler(signal.SIGINT, stop.set_result, None)\n\n    # Serve the server\n    async with aioudp.serve(\"localhost\", 9999, handler):\n        await stop  # Serve forever\n\nif __name__ == '__main__':\n    asyncio.run(main())\n```\n\nAnd a client to connect to the server:\n\n```py\nimport asyncio\n\nimport aioudp\n\n\nasync def main():\n    async with aioudp.connect(\"localhost\", 9999) as connection:\n        await connection.send(b\"Hello world!\")\n        assert await connection.recv() == b\"Hello world!\"\n\nif __name__ == '__main__':\n    asyncio.run(main())\n```\n\n## Installation\n\nYou can get this project via `pip`\n\n```bash\n$ pip install aioudp\n```\n\n\nOr, if you're using [Poetry](https://python-poetry.org)\n\n```bash\n$ poetry add aioudp\n```\n\n\u003e [!NOTE]\n\u003e This library provides no other abstractions over the existing UDP interface in `asyncio` other than the `async`/`await`-based API. This means there is no implicit protocol handled in this library such as [QUIC](https://en.wikipedia.org/wiki/QUIC). You must write your own, or find another library.\n\n## See also\n\n- [AnyIO](https://anyio.readthedocs.io/en/stable/index.html), a broader asynchronous networking and concurrency library for abstracting over any `async` IO implementation. It has a [similar API](https://anyio.readthedocs.io/en/stable/networking.html#working-with-udp-sockets) (which I didn't know about before I wrote this library)\n- [WebSockets](https://websockets.readthedocs.io/en/stable/), a library for Python to interact with WebSockets. Its API heavily inspired the design of AioUDP.\n- [QUIC](https://en.wikipedia.org/wiki/QUIC), a faster protocol similar to TCP, built on UDP.\n- [AioQUIC](https://github.com/aiortc/aioquic), a Python implementation of QUIC.\n\n## License\n\nThis project is licensed under the [GNU GPL v3+](https://github.com/ThatXliner/aioudp/blob/main/LICENSE.txt).\n\nIn short, this means you can do anything with it (distribute, modify, sell) but if you were to publish your changes, you must make the source code and build instructions readily available.\n\nIf you are a company using this project and want an exception, email me at [thatxliner@gmail.com](mailto:thatxliner@gmail.com) and we can discuss.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthatxliner%2Faioudp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthatxliner%2Faioudp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthatxliner%2Faioudp/lists"}