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

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.6.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.6.0
File Size Uploaded
psychmetal-0.6.0.tar.gz 106.6 kB Details

Built distributions (wheels)

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

Total release size: 964.6 kB

Release files / psychmetal-0.6.0.tar.gz

Download URL psychmetal-0.6.0.tar.gz
Size 106.6 kB
Tags Source
SHA-256 checksum
How to use checksums
af6257195d2faec243fa978e3aea0ee397b667b868db36cb61be30167efefca9
BLAKE2b-256 checksum
How to use checksums
103f739616529cd53b33b7f800e69956b815813295811556caa7f8d67de9fed2
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 6, 2026.

Transparency log

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

Download URL psychmetal-0.6.0-cp314-cp314-macosx_14_0_arm64.whl
Size 171.5 kB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
f54a59f88076db10381f5b78cff93be66e0af9001c303560ab0c6246e8d5665d
BLAKE2b-256 checksum
How to use checksums
5cb3ce74a4ebc17a371feea2c67665c69a663e53caff957e344a5d0fb120dbb2
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 6, 2026.

Transparency log

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

Download URL psychmetal-0.6.0-cp313-cp313-macosx_14_0_arm64.whl
Size 171.5 kB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
c3990817d9cd79faf850f684750a580101d5ec7dabeb6a843792ac6f39cd0a65
BLAKE2b-256 checksum
How to use checksums
d0c59d537548cfec6a08478db8b7827b67363c04ab9d944495e6dbc2c29fb2fe
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 6, 2026.

Transparency log

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

Download URL psychmetal-0.6.0-cp312-cp312-macosx_14_0_arm64.whl
Size 171.6 kB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
46e131f1482741a1c615686adf0a7cb39f1163bfa7ba45816c4ef8c7e268e9a4
BLAKE2b-256 checksum
How to use checksums
3698ffa3514a8c72e4749ea97ec425178c389a88fd062a73dbbe770a0aebc300
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 6, 2026.

Transparency log

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

Download URL psychmetal-0.6.0-cp311-cp311-macosx_14_0_arm64.whl
Size 171.7 kB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
1181ce582f143793958917ca438803605f3add65f868d6b37722f87d21b5fcba
BLAKE2b-256 checksum
How to use checksums
c35612083d61490632decbceebe9c3f125e1b331724a6cdeb179a8738f11de57
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 6, 2026.

Transparency log

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

Download URL psychmetal-0.6.0-cp310-cp310-macosx_14_0_arm64.whl
Size 171.7 kB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
44c30a59fb03bc4a02df81288456a55b00ec8b57548d5568bf75f2a91e63ae4c
BLAKE2b-256 checksum
How to use checksums
b530aa5cf1ea12762747744a8b95a07bb79cb49594aa34fdb4955386fee5bc01
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 6, 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

This release

0.6.0 This release

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