Skip to main content

Asynchronous framed datapackage transport over arbitrary byte streams.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: asyncdatapackage-0.1.0.tar.gz
  • Upload date:
  • Size: 3.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.0.tar.gz
Algorithm Hash digest
SHA256 f8e049d9f455fafd2df54dd0bb8c6f292f67d8ad6da900fedb6e555005a11a6a
MD5 211ab4eb554ca65410f444ceaab0e42a
BLAKE2b-256 efc2ae9940dbb46cc5f87d1eab26b122a58a189619d75140f1138689cb45fd4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asyncdatapackage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd936274d2d86b91570f17361905e14cce259347e32143991e7d2d40cdee2a3f
MD5 5a8176848ec548e1f65c843e24d71df2
BLAKE2b-256 9546d059d17496ab1f0406f44aa409ed95a02e4b33176c36fc836c78ad25ebb7

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