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.2.tar.gz (3.0 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.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pymotego-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1da31278288f259228c9fc8129a2b7bd921fa584430c630afb22172bdd055428
MD5 eff3dcb9e9a5636865fb33be5ca37d75
BLAKE2b-256 ab84ce87e7f4e0bcc4424976907108f377620ddc2f17bcd4deece39db82746d1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pymotego-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 382edd3b851620a68d004d3a49344fbd4c7f01af44c5bb9b1cf17bb2db868f83
MD5 40c7b38470b322f715b590432c74e2f5
BLAKE2b-256 86e1095076a3541b3f289427830519f9af46223a912bead4d6035e8b88985d1a

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