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

Uploaded Python 3

File details

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

File metadata

  • Download URL: asyncdatapackage-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 c1523673c0cd0fcfbe909111af7745e22437832599ac2195974a0206e2276a9a
MD5 c1e0743b8f4da63ceb6845360c292b54
BLAKE2b-256 e489955d51035f9229ba746744f36ac07cbaa815911c737ae98cb4e6e78e0175

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asyncdatapackage-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7f1deacce64605c9a41bcd393cba6132303908a855f86c2217a0ac2458f80344
MD5 a2346a41a42cd2bb9900f4e44a71d56e
BLAKE2b-256 04c672e42c2fcd90d3cdcda1670f2c95e0bc5652c224543cecb904337bf1b78b

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