Skip to main content

psychmetal

Native Metal stimulus presentation on Apple silicon Macs, from Python, with an interface resembling Psychtoolbox's Screen. There is no OpenGL anywhere in the path. The same engine serves PsychMetal for MATLAB and Octave.

Version 0.7.1 supports iPhone/iPad through a separately built app: see iOS instructions. The GitHub release includes blob_array_demo.py, a labelled counterphasing array with mouse or one-finger dragging.

Install it into a virtual environment. Homebrew's Python (and any Python following PEP 668) refuses packages installed outside one:

python3 -m venv ~/venvs/psychmetal          # once
source ~/venvs/psychmetal/bin/activate      # in each new Terminal window
pip install psychmetal

Requires macOS 14 or later on Apple silicon, an arm64 Python 3.10 or later, and numpy.

import psychmetal as pm

with pm.open_window(0, [0, 0, 0]) as (w, rect, ifi):
    pm.fill_rect(w, [255, 0, 0], [100, 100, 300, 300])
    vbl, onset, flip_return, missed, slipped = pm.flip(w)
    pm.wait_secs(1)

Each PsychMetal command is a function with the snake_case name and the same arguments, order and defaults as in MATLAB; MATLAB's [] is None. Colours run 0–255 by default. Key indices are 0-based (kb_name('ESCAPE') is 40). Several rectangles, dot positions and per-item colours keep MATLAB's 4xN, 2xN and 3xN/4xN orientation, and images are numpy arrays (H, W[, C]) in any memory layout, read without copying. help(psychmetal) covers threading, batching and the other details.

Demos and hardware checks (Gabors, dynamic noise, textures, dot motion, keyboard, an inventory of every command) are in the repository's python folder.

Flip timestamps come from Metal's presentation reports, not a photodiode. See the repository for validation and its limits.

MIT license.

Metadata

Release files for psychmetal 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psychmetal 0.7.1
File Size Uploaded
psychmetal-0.7.1.tar.gz 128.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for psychmetal 0.7.1
File
psychmetal-0.7.1-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details
psychmetal-0.7.1-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details
psychmetal-0.7.1-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details
psychmetal-0.7.1-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details
psychmetal-0.7.1-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details

Total release size: 1.1 MB

Release files / psychmetal-0.7.1.tar.gz

Download URL psychmetal-0.7.1.tar.gz
Size 128.1 kB
Tags Source
SHA-256 checksum
How to use checksums
93436726823ee9ee6037755262e3a1650ab93564d4deeea488ebf326c28e04ff
BLAKE2b-256 checksum
How to use checksums
f186d4c598456a71f497a8e33eb8a3697b9a9f89e914e7e84dde8143ec39b3cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / psychmetal-0.7.1-cp314-cp314-macosx_14_0_arm64.whl

Download URL psychmetal-0.7.1-cp314-cp314-macosx_14_0_arm64.whl
Size 197.9 kB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
37566aa5ca4a95b76742330516e433fe834ab609ae0c07aae667bc848e97bf3f
BLAKE2b-256 checksum
How to use checksums
825c2077f4af682227c6dac78b85376488a125b6b24ab8b40fa0ec0f8543abef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / psychmetal-0.7.1-cp313-cp313-macosx_14_0_arm64.whl

Download URL psychmetal-0.7.1-cp313-cp313-macosx_14_0_arm64.whl
Size 197.9 kB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
418b3f9a7bb701011dad6517768db42ede4f37349d5bdad09bc770fba22dbef5
BLAKE2b-256 checksum
How to use checksums
fd2858bff3ca5eb63246daa3db4095a5821681d6cd3bb128ad8c613246a90561
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / psychmetal-0.7.1-cp312-cp312-macosx_14_0_arm64.whl

Download URL psychmetal-0.7.1-cp312-cp312-macosx_14_0_arm64.whl
Size 197.9 kB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
b3c982c4dab26c81c23f0cec901b06c32c7f766b4c830820eda15872792cc5cb
BLAKE2b-256 checksum
How to use checksums
a7f7a25936f3dc0a1a894e39af6253c6d5862fbd1dec1cdc1d1f833012a7cdcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / psychmetal-0.7.1-cp311-cp311-macosx_14_0_arm64.whl

Download URL psychmetal-0.7.1-cp311-cp311-macosx_14_0_arm64.whl
Size 198.0 kB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
0cf399c11c674767e8f2dc13f253d5ce37478ccda76b59db322206a8f643a22c
BLAKE2b-256 checksum
How to use checksums
e17842a1fb022097ab525b572289d052317ee7747a1ded55df950d6ffdd17314
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / psychmetal-0.7.1-cp310-cp310-macosx_14_0_arm64.whl

Download URL psychmetal-0.7.1-cp310-cp310-macosx_14_0_arm64.whl
Size 198.0 kB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
8fc43d5d1f42e47d5d1ded83ca89da5c339e463a482aa0d575a46a269cdc8bca
BLAKE2b-256 checksum
How to use checksums
68ceb387dede1dc645b56b1585fa88bf8570318a0f257dfaecf6bf031849068a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

6 release files

0.9.0

6 release files

This release

0.7.1 This release

6 release files

0.7.0

6 release files

0.6.0

6 release files

0.5.1

6 release files

0.5.0

6 release 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