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

Uploaded Python 3

File details

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

File metadata

  • Download URL: asyncdatapackage-0.1.6.tar.gz
  • Upload date:
  • Size: 4.3 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.6.tar.gz
Algorithm Hash digest
SHA256 6d5247c2e2219cc325e7a8d04eface45ce875b7aa37e8d0ea25cfb0132d57839
MD5 e5625813f20f7e490c7f43753b503139
BLAKE2b-256 45299840cfd90ff22c03409f9e153dba531c2a53fc86161ccbf56e0efa70614b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asyncdatapackage-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2c42ff433d61e9e8c40ed0b5351c0097d7c0999555570450eea4c12c492818cd
MD5 4f085daea87fc8b3b2b450e941a12fb5
BLAKE2b-256 e2b8094828e58345bc1ccce631098deeda9e51cf5cf7bf94fa5b86ddd53dda1a

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