Skip to main content

`python` binding for `cogmoteGO`

Project description

pymoteGO

python binding for cogmoteGO

Installation

pip install pymotego

or

uv add pymotego

Usage

Data broadcast

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymotego-0.1.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymotego-0.1.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pymotego-0.1.3.tar.gz.

File metadata

  • Download URL: pymotego-0.1.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.3

File hashes

Hashes for pymotego-0.1.3.tar.gz
Algorithm Hash digest
SHA256 18df4cbe6efcd0d7f5e48afa0490796f7928873e8d4067865f5db5c3e4b02733
MD5 384f96f05b8ab6b06c8e64c9ded43db0
BLAKE2b-256 d438f9b4434dd1671f1e6f5c01afed23e739f166b6920410dcd89d97b3b83acd

See more details on using hashes here.

File details

Details for the file pymotego-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pymotego-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.3

File hashes

Hashes for pymotego-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 57bfc253e5344aba3000e510de3748dc91ca0bf5e230094d414ffb7455c28c6e
MD5 db4e6ca3bcff8bc27842baed1cfe1d81
BLAKE2b-256 6b7c898b3f1af42f010bf08195030d44232a1ba68a1e846d780c1d617f6b90b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page