Metadata-Version: 2.4
Name: labx-py
Version: 2025.8.5.post1
Summary: Labx Python Client
Author-email: "Zi-Jian Yi (伊子健)" <arrowzeke@gmail.com>
License: GPL
Project-URL: Repository, https://github.com/i-z-j/labx-py
Keywords: labx,labserver
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic>=2.11.7
Dynamic: license-file

# Labx
Lab Environment Task Manager
## labx-py
Labx Python Client
### Usage
#### Install
```sh
pip install labx-py
```
#### Example
```py
import labx

# Initiate labx client and test connection
labx.connect()
# Or with custom labx service url
# labx.connect("http://labx-svc")
# Default labx service url can be set via env variable LABX_URL 

# Print connected state
print(labx.connected())

# Print worker profiles
print(labx.profiles())

# Print tasks
print(labx.tasks())

# Config and Run Task
run_req = labx.RunRequest(
    task_name="my_task",
    profile_name="gpu-light",
    params_list=[
        {"img_url": "url1", "resol": 0},
        {"img_url": "url2", "resol": 0},
    ],
    extra_cfg={}
)
run_id = labx.run(run_req)

# Waiting for Run ...
import time
while "running" == labx.status(run_id).state:
    time.sleep(60)
    print(f"Task {run_id} is running ...")

# Check Run Status and Output
print("Final Status:", labx.status(run_id))
print("Output:", labx.output(run_id))
```
