Skip to main content

pixelactions (Python)

Drive desktop interactions from a session a human marked — click a label, not a coordinate, and confirm it landed.

pip install pixelactions

Needs the pixelactions binary on PATH:

brew install nolindnaidoo/tap/pixelactions   # macOS
cargo install pixelactions                   # anywhere with Rust

Use it

from pixelactions import Session

with Session("~/captures/login") as ui:
    ui.click("email")
    ui.write("me@example.com")
    ui.key("tab")
    ui.write("hunter2")
    ui.click("submit")
    ui.wait("dashboard")

Mark email, submit and dashboard once, by hand, with pixelcoords. The script then survives the window moving: every step re-locates its region before acting.

Compare the usual version, which is wrong the moment anything shifts:

pyautogui.click(812, 440)

Verbs

Method Does
click(label) · double_click(label) click the region's point
write(text) type text — write, because type is a keyword
key(chord) a chord like cmd+s, arriving as keys not characters
drag(start, end) press at one region, release at another
scroll(label, n, horizontal=False) wheel over a region; negative reverses
verify(label) is the region still what it was?
wait(label) · gone(label) block until it matches, or until it disappears
changed(label, tolerance=…) did it change? the strongest post-action check
pause(ms) when there is genuinely no observable
relocate() where is everything now, without acting

Failure is two different things

from pixelactions import StepFailed, ProtocolError

try:
    ui.wait("dashboard")
except StepFailed as e:      # it ran, and the answer is no
    print(e.report.detail)   # "timed out after 30s (48 polls, best 0.71)"
except ProtocolError as e:   # the question was wrong
    print(e)                 # 'no selection labeled "dashbord"'

That is the same line the binary's exit codes draw, and it is worth keeping: a timeout is a fact about the screen, a typo'd label is a fact about your code.

Pass raise_on_failure=False to get the report back instead of an exception.

Settings

Anything the flow file's [settings] table takes:

Session("~/captures/login", settings={"failsafe": False, "timeout_ms": 5000})

failsafe is the corner kill switch — park the pointer in a screen corner and a run stops. It cannot work on Wayland, which will not report the pointer, so a flow there must turn it off deliberately.

How it works

A pixelactions serve child process and newline-delimited JSON over its stdin and stdout — the line protocol. No FFI, no native module, no dependencies.

The version tracks the binary it drives. There is no separate client version to reason about.

Releasing

Manual, like the crates — PyPI will not let a version be replaced, only yanked, so it is a button someone presses rather than a side effect of a tag.

Run the Publish the Python client workflow from the Actions tab. It defaults to TestPyPI; choose pypi for the real thing. The version comes from pyproject.toml, which a test holds equal to the workspace — there is no version input to get wrong.

Publishing uses Trusted Publishing, so there is no API token stored anywhere. One-time setup on each side — owner nolindnaidoo, repository pixelactions, workflow publish-python.yml, and environment matching the target (testpypi or pypi).

MIT.

Metadata

Release files for pixelactions 0.9.7

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

Source distribution (sdist)

Source distribution for pixelactions 0.9.7
File Size Uploaded Provenance Actions
pixelactions-0.9.7.tar.gz 10.4 kB With provenance Details for pixelactions-0.9.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pixelactions 0.9.7
File Interpreter ABI Platform Actions
pixelactions-0.9.7-py3-none-any.whl Python 3 none any Details for pixelactions-0.9.7-py3-none-any.whl

Total release size: 21.5 kB

Release files / pixelactions-0.9.7.tar.gz

Download URL pixelactions-0.9.7.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
88604644dcc22e1ca618b32c82d804de146493c40e7ed51852c302583a5e57ba
BLAKE2b-256 checksum
How to use checksums
014596f0af42bac96021f336f9eee883a16d8ddf552012e926d42b4724f36e17
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 Aug 5, 2026.

Transparency log

Release files / pixelactions-0.9.7-py3-none-any.whl

Download URL pixelactions-0.9.7-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a54cc05b273c6b8e1eaf7cbdf8febc6bbefd8fca6395e5e7d8197ee68edbb78
BLAKE2b-256 checksum
How to use checksums
a85b91362a580c63ffe0c7ec9a495d436081fe1aefd173a49ad6d93646e474c2
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 Aug 5, 2026.

Transparency log

Security for pixelactions 0.9.7

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pixelactions-0.9.7.tar.gz

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 Aug 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.7 This release

2 release files Full provenance

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