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.7.tar.gz (4.2 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.7-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: asyncdatapackage-0.1.7.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

Hashes for asyncdatapackage-0.1.7.tar.gz
Algorithm Hash digest
SHA256 39076cf3d55063a00bda7537786fbaa87cd75ec7252ee40b1ca7de925c9e3780
MD5 72faa218ec707020438de8694609f00e
BLAKE2b-256 0a2cd6c2183cb1bd724f5fc574c89f589dbbdaab433cc8a75aa699412f3d8787

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asyncdatapackage-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 68bd8a03f22a637cfc0f729e3162bd47e59411cab91899119fdf9664ab331f4a
MD5 a0b8b1762c9644a7c5381bd5f182c03b
BLAKE2b-256 4dc37d8fb76d9e8e00883b58338b00ed23395056bf78b4163af152caa2eba317

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