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.1.tar.gz (11.5 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.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pymotego-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cfb269849a58f8fa9941ba573d15d823b7f75abaaf7fc36989163922a3d72749
MD5 9d5ab2fb6f9dd8d7f0532f5b0f663ae0
BLAKE2b-256 2fa266823320aa768048293c800737a09f7c3f05d180cd8909cf01ec35290eb9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pymotego-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46720cfcbae27f93c14accb9f6e802aad99c0efc115d994a06a200d7b094d4a3
MD5 8f710f02561d121052e94b0362ff9061
BLAKE2b-256 e9bcda7bd287cba11107dc6fba9a6275a2d24ee3567c19a901593ab44e015c3c

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