Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

vstimd-client

Python client for the vstimd visual stimulus server. Talks to the server over ZMQ using protobuf encoding.

The distribution is vstimd-client; the import package is vstimd.

Install

pip install vstimd-client

Or with uv:

uv add vstimd-client

Development install

cd client/python
uv sync
make proto   # the protobuf stubs are generated, not committed

A checkout without generated stubs imports as an empty shell, so run make proto (every other make target does it for you) before working from source.

Quick start

from vstimd import Connection
from vstimd.stimuli import Vec2, Color

with Connection() as conn:
    h = conn.stimuli.shapes.create_rect(pos=Vec2(-200, 0), width=300, height=200,
                                        color=Color(1.0, 0.0, 0.0))
    conn.stimuli.set_enabled(h, False)
    conn.stimuli.delete(h)
    info = conn.system.query_server_info()
    print(info.version)

Connection(address="tcp://localhost:5555") — default address shown.

vstimd.psychopy — PsychoPy-compatible layer

Drop-in replacement for psychopy.visual:

# Before
from psychopy import visual

# After
from vstimd.psychopy import visual

The only required addition is address= on Window:

win = visual.Window(address='tcp://192.168.1.10:5555')
circ = visual.Circle(win, radius=50, fillColor='red')
rect = visual.Rect(win, width=200, height=100, fillColor=(-1, 1, -1))
grat = visual.GratingStim(win, sf=0.05, mask='circle')
circ.draw()
win.flip()

Implemented classes

Class Notes
Window Owns the Connection; flip() flushes the command queue
Rect create_rect, position, size, fill color, orientation, alpha
Circle create_circle, position, radius, fill color, orientation, alpha
GratingStim create_grating, all grating parameters; mask accepts 'circle', 'gauss', 'raisedCos'

All constructor arguments from psychopy.visual are accepted. Parameters that have no server-side equivalent (autoLog, depth, interpolate, etc.) are accepted and silently ignored for drop-in compatibility.

Deferred (frame-buffer) mode

By default (deferred=True) property changes are sent to the server's deferred queue immediately; win.flip() tells the server to apply the entire queue atomically before the next vsync. Set deferred=False to apply each command immediately as it arrives.

Color formats accepted

Named strings ('red'), hex strings ('#ff0000'), PsychoPy rgb tuples (-1..1), plain 0..1 tuples, rgb255 tuples, and scalar greyscale values.

vstimd-client — command-line tool

Installing the package also installs a vstimd-client executable for the system-level commands, plus mDNS discovery of servers on the local network:

pip install 'vstimd-client[discover]'   # [discover] adds the pure-Python mDNS backend
$ vstimd-client discover
ID             HOSTNAME             ADDRESSES   ADDRESS
vstimd-a1b2c3  vstimd-a1b2c3.local  10.0.1.42   tcp://vstimd-a1b2c3.local:5555

$ vstimd-client --host vstimd-a1b2c3 info
version     0.4.1
resolution  1920x1080
frame rate  60.00 Hz
background  0.000 0.000 0.000 1.000

Discovery browses for _vstimd._tcp using the zeroconf package if it is installed, and otherwise falls back to avahi-browse. The ID column is the server's id= TXT record — the reliable identity, unlike the display name which Avahi may suffix with #2 on collision.

Other commands: ls, background, delete-all, enable-all/disable-all, wait-frames, wait-ready, shutdown, and config list|save|load|get|upload. The target server comes from --address, --host, $VSTIMD_ADDRESS, or tcp://localhost:5555, in that order. --json makes every command emit machine-readable output. See vstimd-client --help and the CLI docs for details.

Regenerating protobuf stubs

cd client/python
make proto   # requires grpcio-tools in the dev dependency group

Tests

cd client/python

# Unit tests (no server required)
make test

# E2E against the null renderer (builds server binary automatically)
make test-e2e-null

# E2E against a real running server
VSTIM_SERVER_ADDR=tcp://192.168.1.10:5555 make test-e2e

Status and versioning

Pre-1.0: the API may still change between minor versions.

Release candidates (0.1.0rc1) are published to PyPI. While no final release exists yet, pip install vstimd-client resolves to the newest candidate — pip falls back to pre-releases only when nothing stable satisfies the request. Once 0.1.0 is out, that same command gives you the stable version, and picking up later candidates needs pip install --pre vstimd-client.

License

GNU LGPLv3. Copyright © 2026 Joscha Schmiedt, University of Bremen.

The client is licensed more permissively than the vstimd server itself, which is AGPLv3: importing this package into your experiment does not place your experiment under copyleft.

Download files

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

Source Distribution

vstimd_client-0.1.0rc1.tar.gz (78.4 kB view details)

Uploaded Source

Built Distribution

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

vstimd_client-0.1.0rc1-py3-none-any.whl (113.9 kB view details)

Uploaded Python 3

File details

Details for the file vstimd_client-0.1.0rc1.tar.gz.

File metadata

  • Download URL: vstimd_client-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 78.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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 vstimd_client-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 9d7ee624b13ea20c9ba3990563a8566ab3e55d63480dd626fa978f2512d4b0a1
MD5 ab5c20820c9501edce9c23a1278005b3
BLAKE2b-256 f57edd3a5ecea959a12478ea3f535bf0d49aa8c653d2527bd06674754386951d

See more details on using hashes here.

File details

Details for the file vstimd_client-0.1.0rc1-py3-none-any.whl.

File metadata

  • Download URL: vstimd_client-0.1.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 113.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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 vstimd_client-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 168ff82e758e6a3f733db9eb067958cd433799b3d496e3bf73731b545ed508a1
MD5 5e77924d729ef1b0ffb27f1a80c7555b
BLAKE2b-256 2d542cf0675c2f5f3e155a6777a9b2dd866627a1aa494292ac8b01626fa570c6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0rc1 This release

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