Metadata-Version: 2.1
Name: aioflows
Version: 0.1.0
Summary: Python data flows library to build structured applications
Author-email: Anton Patrushev <apatrushev@gmail.com>
License: MIT
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries
Requires-Python: <3.11,>=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cached-property
Requires-Dist: janus
Requires-Dist: pydantic <2
Provides-Extra: dev
Requires-Dist: pytest-asyncio ; extra == 'dev'
Requires-Dist: spherical-dev[dev] <0.4,>=0.3.0 ; extra == 'dev'
Provides-Extra: examples
Requires-Dist: aioconsole ; extra == 'examples'
Requires-Dist: aiohttp ; extra == 'examples'
Requires-Dist: aiomqtt ; extra == 'examples'
Requires-Dist: requests ; extra == 'examples'
Requires-Dist: zeroconf ; extra == 'examples'
Provides-Extra: release
Requires-Dist: spherical-dev[release] <0.4,>=0.3.0 ; extra == 'release'

# aioflows
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![PyPI](https://img.shields.io/pypi/v/aioflows)](https://pypi.org/project/aioflows/)

This project aims to implement a helper library for building asynchronous applications in Python, based on the concept of structured data flows and actors. The current stage is pure proof-of-concept and basis for discussion with colleagues and community. It is not intended to be used in any production or even pet projects.

## Minimal working example
```python
import asyncio

from aioflows.simple import Printer, Ticker


async def start():
    await (Ticker() >> Printer()).start()


asyncio.run(start())
```

## Udp echo example
```python
import asyncio

from aioflows.network import Udp
from aioflows.simple import Printer, Tee


async def start():
    udp = Udp(local_addr=('127.0.0.1', 5353), reuse_port=True)
    await (udp >> Tee(Printer()) >> udp).start()


asyncio.run(start())
```

You can test it with socat:
```bash
socat - UDP:localhost:5353
```

## Other examples
More examples can be found in [src/examples](https://github.com/apatrushev/aioflows/tree/master/src/examples).

## Installation
 - local
```bash
pip install .
```

 - editable
```bash
pip install -e .
```

 - development
```bash
pip install -e .[dev]
```

 - examples dependencies
```bash
pip install -e .[examples]
```

 - all together
```bash
pip install -e .[dev,examples]
```

 - from github
```bash
pip install git+https://github.com/apatrushev/aioflows.git
```

## Usual development steps
Run checks and tests:
```bash
inv isort flake test
```

Run examples (all ERRORCODE's should be 0/OK or timeout at the moment):
```bash
inv examples | grep ERRORCODE
```

## Similar projects
I found existing solutions that are almost equal to this concept:
 - https://github.com/ReactiveX/RxPY
 - https://github.com/vxgmichel/aiostream
