Metadata-Version: 2.4
Name: asyncdatapackage
Version: 0.1.8
Summary: Asynchronous datapackage serializer and transport layer
Author: Specter
Keywords: asyncio,networking,transport,datapackage,tcp,async
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# 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:

```python
await send(bytes)
await receive(...)
```

---

## Installation

```bash
pip install asyncdatapackage
```

---

## Quick Example

```python
from asyncdatapackage import AsyncDataPackage
```

```python
datapackage = AsyncDataPackage(
    write_function=my_send,
    read_function=my_receive
)

await datapackage.start()
```

Send:

```python
await datapackage.send_datapackage(
    {
        "type": "DATA",
        "message": "hello"
    }
)
```

Receive:

```python
packet = await datapackage.receive_datapackage()
```

Result:

```python
{
    "type": "DATA",
    "message": "hello"
}
```

---

## Features

- asyncio-native
- Dynamic parameter updates
- FIFO packet queue
- Automatic frame reconstruction
- Fragmentation tolerant
- Transport independent

---

## License

MIT
