Authoring in Code (SDKs)
Studio is the fastest way to build a study visually, but some research workflows are better served by code: when you want a study under version control, generated programmatically from a stimulus set, reproducible from a script, or reviewed in a pull request. PsyCloud offers two first-class authoring SDKs for exactly that.
A fluent, chainable builder for Python.
A pipe-friendly (|>) builder for R.
One model, one bundle
Both SDKs express the same model and compile to the same bundle format — the same artifacts
Studio produces (designProgram.json, screenProgram.json, bindings.json, and friends). That
means:
- A study authored in code runs on the same runtime as one built in Studio.
- You can import a code-authored bundle into Studio to keep editing visually, and export Studio or imported studies back to Python/R code. See Interoperability.
The authoring shape is identical across languages — you describe an experiment, add phases that generate trials from factors, define a screen for each trial, and bundle it:
from psycloudpy import experiment, text, keypress
from psycloudpy.expr import col
bundle = (
experiment(id="hello.stroop", name="Hello Stroop")
.phase("main")
.factors(word=["red", "blue"], ink=["red", "blue"])
.cross()
.shuffle()
.screen("trial")
.ask(text(col.word, fill=col.ink), keypress(keys=["r", "b"]))
.bind_self("word", "ink")
.bundle(with_auto_ids=True)
)Install
# From the PsyCloud monorepo (not yet on PyPI)
pip install -e packages/psycloudpyPick the language you already analyze your data in. The two SDKs are intentionally feature-matched, and many example studies ship in both — so your choice is about ergonomics, not capability.