Skip to main content

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

asyncdatapackage-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asyncdatapackage-0.1.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file asyncdatapackage-0.1.1.tar.gz.

File metadata

  • Download URL: asyncdatapackage-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for asyncdatapackage-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f9c2027553ce6408b75699adb006942c44209c72f7bd22f2268b21f438aaa65f
MD5 1b9d864aae302c7011ff5af4a386d4d2
BLAKE2b-256 b3a5f927f47e3b164e53e2b986e58dd954d79fe0b77ea9992602e0cf7dfa17c4

See more details on using hashes here.

File details

Details for the file asyncdatapackage-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for asyncdatapackage-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ddcde517366329566e370c61c13fcf6949cfcd75ab24d3ff6cfc81e1ef742b4
MD5 6fcfd468110e3e9a30c0e6eb18b60fc7
BLAKE2b-256 066105b0019e7eb49f1294e4665d536b29dc2810bc9bd36992a68f50d303fbd2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page