Metadata-Version: 2.4
Name: anf
Version: 1.1.0
Summary: Layout tasks with async and flower
Home-page: https://github.com/LL-Ling/anf.git
Author: LL-Ling
Author-email: 1309399041@qq.com
License: MIT
Keywords: async flower task job
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 3 - Alpha
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: summary

## Async and Flower
**anf** allows you to elegantly organize and execute your tasks.

## Installation
```console
$ pip install anf
```

## Example
```Python
import asyncio

from anf import run_flower
from anf import FlowerTask


async def fn_param(param: str) -> bool:
    print(param)
    await asyncio.sleep(2)
    return True


async def main():
    function_params = [
        FlowerTask("p1").set_task_id("task_id-1"),
        FlowerTask("p2"),
    ]

    # run with FlowerTask list
    await run_flower(function_params, fn_param, max_tasks=2)

    # run with simple list
    await run_flower(["p1", "p2"], fn_param, max_tasks=1)

    # run with iter list
    function_params = [
        FlowerTask(["p1", "p2", "p3"]).set_iter(["param"]),
    ]
    await run_flower(function_params, fn_param, max_tasks=1)


if __name__ == '__main__':
    asyncio.run(main())

```
