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

Uploaded Python 3

File details

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

File metadata

  • Download URL: asyncdatapackage-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 62ffd3f07440ae24e85dba2a42454adaf365d45aafab810173e061930f8dd2e3
MD5 cf33afea0f804b15244c12e7a658310d
BLAKE2b-256 d126175f1132bae229f2d17d0d5243e047bad6550a83536b2a22921b2178cd7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asyncdatapackage-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 533e8bfa3eb1c6e7fda01c375597333af625c50c3e160072167acde2cc973905
MD5 07deeb36bbefb57a35c6a09c8ce4095a
BLAKE2b-256 1398e7e5567f55c736c97f7d6d251ed8eba47c203e2f2631d08ee316ad3cb76f

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