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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| psychmetal-0.5.0.tar.gz | 65.0 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| psychmetal-0.5.0-cp314-cp314-macosx_14_0_arm64.whl | CPython 3.14 | CPython 3.14 | macOS 14.0+ ARM64 | Details |
| psychmetal-0.5.0-cp313-cp313-macosx_14_0_arm64.whl | CPython 3.13 | CPython 3.13 | macOS 14.0+ ARM64 | Details |
| psychmetal-0.5.0-cp312-cp312-macosx_14_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 14.0+ ARM64 | Details |
| psychmetal-0.5.0-cp311-cp311-macosx_14_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 14.0+ ARM64 | Details |
| psychmetal-0.5.0-cp310-cp310-macosx_14_0_arm64.whl | CPython 3.10 | CPython 3.10 | macOS 14.0+ ARM64 | Details |
Total release size: 660.6 kB
Release files / psychmetal-0.5.0.tar.gz
| Download URL | psychmetal-0.5.0.tar.gz |
|---|---|
| Size | 65.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18e1483c9bfd8443c37f325ff667d28e0c5c5e628f3b82211b8ee961e9b25d07
|
|
BLAKE2b-256 checksum How to use checksums |
39e1ed59817b321b31b0e0cd5771bdb2e80f52349ee16f5f79c3667735746229
|
| 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 Sep 30, 2026.
Transparency logRelease files / psychmetal-0.5.0-cp314-cp314-macosx_14_0_arm64.whl
| Download URL | psychmetal-0.5.0-cp314-cp314-macosx_14_0_arm64.whl |
|---|---|
| Size | 119.0 kB |
| Tags | CPython 3.14 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b26d4ac8a690ed3defbf097575455b576961977cd4d743fd7f6cd74f60220a62
|
|
BLAKE2b-256 checksum How to use checksums |
1ff115da5ac4411ffec6c5748cce2a66ba662b002b204447281ad9501aa96a1a
|
| 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 Sep 30, 2026.
Transparency logRelease files / psychmetal-0.5.0-cp313-cp313-macosx_14_0_arm64.whl
| Download URL | psychmetal-0.5.0-cp313-cp313-macosx_14_0_arm64.whl |
|---|---|
| Size | 119.1 kB |
| Tags | CPython 3.13 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0fb941c46823d13c916edf7ea3b62907760d257f6976cb23c34bfdc8b12bf415
|
|
BLAKE2b-256 checksum How to use checksums |
3d28986b2ad5cda98903a636b1916e7b5216311b2cc6b5666cd52658cd8642ec
|
| 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 Sep 30, 2026.
Transparency logRelease files / psychmetal-0.5.0-cp312-cp312-macosx_14_0_arm64.whl
| Download URL | psychmetal-0.5.0-cp312-cp312-macosx_14_0_arm64.whl |
|---|---|
| Size | 119.1 kB |
| Tags | CPython 3.12 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
382df06498896d9ade6b020425e0f0ae13afb9dadcb7b558483df3fcb4780cd5
|
|
BLAKE2b-256 checksum How to use checksums |
b2a7a9632987d8c98c2a4b6056af2e741078963b9f6410c013877d713581c791
|
| 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 Sep 30, 2026.
Transparency logRelease files / psychmetal-0.5.0-cp311-cp311-macosx_14_0_arm64.whl
| Download URL | psychmetal-0.5.0-cp311-cp311-macosx_14_0_arm64.whl |
|---|---|
| Size | 119.2 kB |
| Tags | CPython 3.11 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
03533ce677ea8db6333a1a261c71bae5968f0fe0d1b74791fd5fa57e58745c34
|
|
BLAKE2b-256 checksum How to use checksums |
042ba2237cc891aae97b31933b3c1ba5a946c285b6508602b83ef3479e33e927
|
| 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 Sep 30, 2026.
Transparency logRelease files / psychmetal-0.5.0-cp310-cp310-macosx_14_0_arm64.whl
| Download URL | psychmetal-0.5.0-cp310-cp310-macosx_14_0_arm64.whl |
|---|---|
| Size | 119.2 kB |
| Tags | CPython 3.10 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
880c1260b937268ae7af39cc75550ee09591eff8cc5bc366ffea6e5ea5dd0cd9
|
|
BLAKE2b-256 checksum How to use checksums |
d771b6bc97feb5c9d0846acb35700b1cd71f25838a80ac85c2db57612bdac8ee
|
| 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 Sep 30, 2026.
Transparency log