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.0 also 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.0

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.0
File Size Uploaded
psychmetal-0.7.0.tar.gz 121.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for psychmetal 0.7.0
File
psychmetal-0.7.0-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details
psychmetal-0.7.0-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details
psychmetal-0.7.0-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details
psychmetal-0.7.0-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details
psychmetal-0.7.0-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.0.tar.gz

Download URL psychmetal-0.7.0.tar.gz
Size 121.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a19f8c40fff895e2b95afbdb291601f200a7dd8b5591e63deca1c586c3831bca
BLAKE2b-256 checksum
How to use checksums
1d15b9ab37c4b1e4ed7c854cf0d1df42c7aa64e92c596f84cb652eafb36e0d92
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 8, 2026.

Transparency log

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

Download URL psychmetal-0.7.0-cp314-cp314-macosx_14_0_arm64.whl
Size 188.2 kB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
7b71da8ce456bf3d44e661521367a1ac2296c2cf069af0bf7556f684f04b1ad8
BLAKE2b-256 checksum
How to use checksums
9a57c512346595e5c40b611f68109b1e14021f6fe49ef05140917616a0d107c0
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 8, 2026.

Transparency log

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

Download URL psychmetal-0.7.0-cp313-cp313-macosx_14_0_arm64.whl
Size 188.3 kB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
beea398138d9c570b6e0a010eb9686f0b006df1bab010bee62edcb151d7e387e
BLAKE2b-256 checksum
How to use checksums
50808ff978926fadcfae5ef790b3d1eed0b6ccd2947754e213d01bd671dea4c3
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 8, 2026.

Transparency log

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

Download URL psychmetal-0.7.0-cp312-cp312-macosx_14_0_arm64.whl
Size 188.3 kB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
62c44c44e5cbd5120111ec854cd2c0a8485668b291cd3ba51218b149697e3a52
BLAKE2b-256 checksum
How to use checksums
b43d87c1a62fe47ceb2d995f79f8bdbc452b8ae332ba23dc58dc212c565b6cda
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 8, 2026.

Transparency log

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

Download URL psychmetal-0.7.0-cp311-cp311-macosx_14_0_arm64.whl
Size 188.4 kB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
7a25e481e8a190513586994e4dfdcd1cf08ca32f8d5befc8f6fd26c834a5f4fc
BLAKE2b-256 checksum
How to use checksums
6e41268f02138351573796c644ca6b9b28c80e733357132e23c45455009f32fb
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 8, 2026.

Transparency log

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

Download URL psychmetal-0.7.0-cp310-cp310-macosx_14_0_arm64.whl
Size 188.4 kB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
2a5b3421e43979bfbbf6ac2a81ad42ae153f646f96f7589772546a8c59fa8b0b
BLAKE2b-256 checksum
How to use checksums
d89e75495769fd13a0fc3a8133f2a2b798157ea03e9d96077ca6ad3ca8278e5f
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 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

6 release files

0.9.0

6 release files

0.7.1

6 release files

This release

0.7.0 This release

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