Metadata-Version: 2.3
Name: pymotego
Version: 0.1.3
Summary: `python` binding for `cogmoteGO`
Author: HuYang
Author-email: HuYang <hy.ccccr@gmail.com>
Requires-Dist: httpx[http2]>=0.28.1
Requires-Dist: pyzmq>=27.0.1
Requires-Python: >=3.13
Description-Content-Type: text/markdown

## pymoteGO

`python` binding for `cogmoteGO`

## Installation

```sh
pip install pymotego
```

or

```sh
uv add pymotego
```

## Usage
### Data broadcast

```python
from pymotego.broadcast import Broadcast
from datetime import datetime, timedelta
from time import sleep
import random

broadcast = Broadcast()

results = ["correct", "incorrect", "timeout"]

for i in range(10):
    start_time = datetime.now() - timedelta(seconds=random.randint(1, 60))
    
    duration = random.randint(1, 5)
    stop_time = start_time + timedelta(seconds=duration)
    
    result = random.choice(results)
    
    correct_rate = 1.0 if result == "correct" else 0.0
    
    data = {
        "trial_id": i + 1,
        "trial_start_time": start_time.isoformat(),
        "trial_stop_time": stop_time.isoformat(),
        "result": result,
        "correct_rate": correct_rate
    }
    
    future = broadcast.send(data)
    print(future.result())

    sleep(duration)
```