Metadata-Version: 2.4
Name: task-process-wrap
Version: 0.1.0
Summary: Encapsulate tasks safely using processes.
License-Expression: MIT
License-File: LICENSE
Author: GGN_2015
Author-email: neko@jlulug.org
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Description-Content-Type: text/markdown

# task_process_wrap
Encapsulate tasks safely using processes

## install

```bash
pip install task_process_wrap
```

## usage

```python
from task_process_wrap import TaskProcessWrap
import time


tpw = TaskProcessWrap(["python", "-c", "import time; [(print(i, flush=True), time.sleep(1)) for i in range(100)]"])
tpw.start()


while True:
    print(tpw.info())
    time.sleep(0.5)
    if tpw.info()["status"] in ["done", "killed"]:
        break
    if tpw.info()["run_time"] > 10:
        tpw.kill()


print(tpw.info())
```

