Skip to main content

anybox

one API for the most popular passthrough boxes, from Python. it's the anybox Rust library through its C ABI, so it does exactly what the Rust one does, and the README there has which boxes it supports and how each one behaves

pip install anybox-rs

it's still import anybox in your code. the wheel has the library inside, so you don't need Rust. it's Windows and Linux on x64 and Python 3.11 or newer for now, if you need something else open an issue. on Linux your user has to be allowed to open serial ports, the dialout group on most distros (uucp on Arch)

import anybox

with anybox.connect() as device:
    print(device.snapshot().info)
    device.move_by(100, 0)
    device.click(anybox.Button.LEFT)
    device.tap_key(anybox.Key.A)

anybox.connect() takes the first box it finds, anybox.Connect(port="COM18").open() or anybox.Connect(family=anybox.Family.MEDIUS).open() the one you want, and anybox.scan() gives every port with what's on it, which is what a box picker wants. anybox.candidates() is the cheap one to call every second. leave the with or call close() so anybox lets go of what you held and unlocks what you locked

if a box can't do something you get an anybox.UnsupportedError saying why, and device.snapshot().capabilities[anybox.Action.KEY_TAP] tells you before you try. every error is an anybox.Error with the library's own text

what happens on the box comes in as events:

import anybox

with anybox.connect() as device:
    for event in device.events(anybox.EventKinds.BUTTONS):
        match event:
            case anybox.ButtonEvent(button=anybox.Button.SIDE1, pressed=True):
                print("side button down")
            case anybox.Disconnected():
                print("the box is gone, anybox keeps looking for it")
            case anybox.Reconnected():
                print("it's back")

events.recv(timeout) gives you one at a time instead, None when nothing came in time. iterating ends once the device is closed and everything queued was read. just so you know, a receiver of keys sees every key typed on the keyboard behind the box, passwords included

durations like a click's hold are seconds, and an event's stamp is nanoseconds since the device was opened. a number that doesn't fit what the box takes (a move of 40000 for example) is a ValueError and never gets cut short on its way

what only one box can do stays reachable through that box's own API. on a Medius, device.medius() gives you the medius package's own device for clips, transforms, rendering and the rest, and None on every other box. it needs the extra:

pip install anybox-rs[medius]
import anybox
from medius import RenderMode

with anybox.connect() as device:
    if (medius := device.medius()) is not None:
        medius.set_render(RenderMode.DESPIKED, False)

it shares anybox's connection, so import anybox BEFORE medius, otherwise medius loads its own library and can't use it. anybox doesn't know about anything you press or lock through it

license

MPL-2.0, the wheel has the license, the notice and the licenses of everything built into the library. made by ethereal

Metadata

Release files for anybox-rs 0.8.0

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

Built distributions (wheels)

Table of built distributions (wheels) for anybox-rs 0.8.0
File Interpreter ABI Platform
anybox_rs-0.8.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
anybox_rs-0.8.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details

Total release size: 2.7 MB

Release files / anybox_rs-0.8.0-py3-none-win_amd64.whl

Download URL anybox_rs-0.8.0-py3-none-win_amd64.whl
Size 777.8 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6852ad9beec44d5aacf8c2726ea47a41297dff54ebaac1aa3dc377897789d2b0
BLAKE2b-256 checksum
How to use checksums
fb3efbd185e7d6a2eec83886c84d299d779e8eb0112e31f72878db2bdc05b080
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 14, 2026.

Transparency log

Release files / anybox_rs-0.8.0-py3-none-manylinux_2_28_x86_64.whl

Download URL anybox_rs-0.8.0-py3-none-manylinux_2_28_x86_64.whl
Size 1.9 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
0d56f87647b372525d48e7f6c4b39594544e57a657ebb6f5f56a70fa7b6bba8d
BLAKE2b-256 checksum
How to use checksums
f819dc003d44c81fdd4e8e64a2ff88c2efd5a192bec4bca65b9a782c7d7748a8
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 14, 2026.

Transparency log

Security for anybox-rs 0.8.0

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 anybox_rs-0.8.0-py3-none-win_amd64.whl

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 14, 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.

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