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.

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

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

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.5.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.5.1
File Size Uploaded
psychmetal-0.5.1.tar.gz 68.6 kB Details

Built distributions (wheels)

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

Total release size: 669.6 kB

Release files / psychmetal-0.5.1.tar.gz

Download URL psychmetal-0.5.1.tar.gz
Size 68.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c01ca0b9d49ffb20ffe2d8f5c336cfd0cd9149003c159a1e447ee6665b2e6fdb
BLAKE2b-256 checksum
How to use checksums
a705b00ee91f95e08f0d885d9661544872af5c9f9892d1e5edb02f29ba2e3eb1
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 4, 2026.

Transparency log

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

Download URL psychmetal-0.5.1-cp314-cp314-macosx_14_0_arm64.whl
Size 120.2 kB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
c33da279aace9140cb7c1cf621b394eb74843289efc44ed8331bbd2532d6e78e
BLAKE2b-256 checksum
How to use checksums
c0669da09d0eafcf540e0448688ea6b1ed1d9d26e0eba09df4fc227e1b99ee00
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 4, 2026.

Transparency log

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

Download URL psychmetal-0.5.1-cp313-cp313-macosx_14_0_arm64.whl
Size 120.2 kB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
5f6b9a5aa1690d9e90a3bce55e619f76b1a5f2a7e879ebc75455c9a5d1ed64f3
BLAKE2b-256 checksum
How to use checksums
d512e08906342a5475e4343431cedbb812f2f9b407266521eea1a2323799f68a
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 4, 2026.

Transparency log

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

Download URL psychmetal-0.5.1-cp312-cp312-macosx_14_0_arm64.whl
Size 120.2 kB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
4a70c40addba2c9de727dfab86f14a69808fec46b7c8ada447f21620560b5bc8
BLAKE2b-256 checksum
How to use checksums
013f4409afa23cd6187926e019cbf67a6749352aab20624cae271090c20428fe
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 4, 2026.

Transparency log

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

Download URL psychmetal-0.5.1-cp311-cp311-macosx_14_0_arm64.whl
Size 120.2 kB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
40d259b593e7f962d9d001e9dc20c74791a760bf101cd50af2c9feefbd0d3fa2
BLAKE2b-256 checksum
How to use checksums
e5a8080a472e13f0dd397968f2ce0df678579710b3722321ca374fdecbd23005
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 4, 2026.

Transparency log

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

Download URL psychmetal-0.5.1-cp310-cp310-macosx_14_0_arm64.whl
Size 120.2 kB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
91554b44298e464799b315025f7b3263c73607bf70a807fe2af49d090330ba56
BLAKE2b-256 checksum
How to use checksums
f86f0f8a4ceac296bbb2ebde7c123ad52784b193e36ace4b51f628732577344a
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 4, 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

0.7.0

6 release files

0.6.0

6 release files

This release

0.5.1 This release

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