Asynchronous datapackage serializer and transport layer
Project description
AsyncDataPackage
AsyncDataPackage is a lightweight asyncio-based framing layer that converts arbitrary byte streams into structured Python dictionaries.
It is transport agnostic and can operate on:
- TCP
- SSH
- WebSockets
- Bluetooth
- Serial Ports
- UDP
- Custom transports
The transport only needs to provide:
await send(bytes)
await receive(...)
Installation
pip install asyncdatapackage
Quick Example
from asyncdatapackage import AsyncDataPackage
datapackage = AsyncDataPackage(
write_function=my_send,
read_function=my_receive
)
await datapackage.start()
Send:
await datapackage.send_datapackage(
{
"type": "DATA",
"message": "hello"
}
)
Receive:
packet = await datapackage.receive_datapackage()
Result:
{
"type": "DATA",
"message": "hello"
}
Features
- asyncio-native
- Dynamic parameter updates
- FIFO packet queue
- Automatic frame reconstruction
- Fragmentation tolerant
- Transport independent
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asyncdatapackage-0.1.9.tar.gz.
File metadata
- Download URL: asyncdatapackage-0.1.9.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
617d1bff1bdb8a9edc1d2467f6a3e16528b6733d9a58aacc2623a0b69dbbe396
|
|
| MD5 |
7674427223ad3a82341bfc775442b6d7
|
|
| BLAKE2b-256 |
9c83fd33fb285fd77bb9ecf1f31bf5f6cf0339f88d2a8251b3a38755f17a4ac0
|
File details
Details for the file asyncdatapackage-0.1.9-py3-none-any.whl.
File metadata
- Download URL: asyncdatapackage-0.1.9-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d011c43d1bc0de4e70e218d9a1da17a974bfa73f05d28fd125617d2ba1c67c1e
|
|
| MD5 |
20bbb26ebcd8c1f6563d71541130150e
|
|
| BLAKE2b-256 |
6b388f5897f9af5949afe04f2502ca2e5859f5e4da85b3884ae87b21734b9a0c
|