Skip to main content

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)

Internal backup API

The backup API is available only on cogmoteGO's loopback-only internal listener. The default address is http://127.0.0.1:9011/api/; do not expose this listener through a reverse proxy.

from pymotego import BackupClient, BackupDestination, BackupSource

source = BackupSource(
    root_id="project-data",
    entries=("20260713", "20260714/realdata/result.jsonl"),
)
destination = BackupDestination(
    root_id="lab-nas",
    path="experiments/project/data",
)

with BackupClient() as client:
    created = client.create(source, destination)
    current = client.current()

print(created.id, current.status if current else "no task")

The source and Samba root IDs must already be configured in cogmoteGO. Creating a backup starts an asynchronous task; call current() to fetch its latest state. Before any task has been created, current() returns None.

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.6.tar.gz (5.6 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.6-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymotego-0.1.6.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymotego-0.1.6.tar.gz
Algorithm Hash digest
SHA256 0773ccde422f5f8c8e45033f12c429e3ce409ad08c269fab0a502c8915a8d87e
MD5 4fb379592fc58f593505f057d27970cc
BLAKE2b-256 6e6d2d8581a5167b94a2f4c29b928733e13d140cd0d2d4fdb80269f91f210498

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymotego-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymotego-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7162051fce03788d1829399869f0d60e855ef71be69f4f64c86e4db640fc654a
MD5 694867c3b9fbe42536f6fde99608c921
BLAKE2b-256 ebe09494226538838a3ed790ce377a03518eeb8206775a985d033235c75ee550

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page