Skip to main content

MiraBox N4 Pro for Python

Async Python bindings for the Rust mirabox-n4pro crate. Requires a supported HID device and Python 3.9 or newer.

From the mirabox-n4pro-py directory, install with python -m pip install . (requires a Rust toolchain; pip installs maturin as the build backend).

For editable development, from the repository root (with just and uv installed):

just install-maturin  # Set up maturin in mirabox-n4pro-py/.venv (optional separate step)
just install-python   # Build and install the module; also sets up maturin
mirabox-n4pro-py/.venv/bin/python -c 'import mirabox_n4pro; print(mirabox_n4pro.PHYSICAL_BUTTON_IMAGE_SIZE)'

The project-local .venv is ignored by Git. Rerun just install-python after changing Rust code.

import asyncio
from mirabox_n4pro import MiraboxN4Pro, PHYSICAL_BUTTON_IMAGE_SIZE

async def main():
    device = await MiraboxN4Pro.connect()
    if device is None:
        print("No MiraBox N4 Pro found")
        return

    print(device.serial_number, PHYSICAL_BUTTON_IMAGE_SIZE)
    # Supply an already encoded JPEG or PNG at 112x112, rotated 180°.
    with open("button.jpg", "rb") as image:
        await device.set_image(MiraboxN4Pro.physical_button_image_key(0), image.read())
    await device.flush()

    while True:
        report, event = await device.read_report_event()
        if event is not None:
            print(event)

asyncio.run(main())

All I/O methods return awaitables. set_image queues bytes until flush; set_background_image uploads immediately. read_event returns a dictionary or None for an unknown report; read_report_event returns (bytes, event) and retains all 512 raw bytes. Event dictionaries contain type (button, knob_pressed, knob_rotated, touch_start, touch_move, touch_end, or swipe) plus the corresponding fields (button/pressed, knob/direction, x/y, code, or direction). Indices for physical buttons and knobs are zero-based. Keep-alive is caller-controlled via await device.keep_alive(); the binding does not create a background task.

Other methods: set_screen_brightness (0–100), set_light_brightness (0–60), set_led_colors (four RGB triples), set_vibro_feedback, and clear_background_image. Image sizes are exposed as PHYSICAL_BUTTON_IMAGE_SIZE and VIRTUAL_BUTTON_IMAGE_SIZE. Device/transport failures raise OSError; invalid brightness/background dimensions raise ValueError.

Metadata

Release files for mirabox-n4pro 0.1.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 mirabox-n4pro 0.1.1
File Size Uploaded Provenance
mirabox_n4pro-0.1.1.tar.gz 27.2 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for mirabox-n4pro 0.1.1
File
mirabox_n4pro-0.1.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
mirabox_n4pro-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
mirabox_n4pro-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
mirabox_n4pro-0.1.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
mirabox_n4pro-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details

Total release size: 3.1 MB

Release files / mirabox_n4pro-0.1.1.tar.gz

Download URL mirabox_n4pro-0.1.1.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2bcf603e97a452cba6c0b5375085a46899aefb0053c22ad56fad0a71597db638
BLAKE2b-256 checksum
How to use checksums
017e923d23dae297b90e8521110632285787d0b60c2568420342621e4efdae26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Release files / mirabox_n4pro-0.1.1-cp312-cp312-win_amd64.whl

Download URL mirabox_n4pro-0.1.1-cp312-cp312-win_amd64.whl
Size 475.9 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
30d703b22a4fa7b0991abbefc91e685f90bc475b9407c5414baa063da1a8a2c5
BLAKE2b-256 checksum
How to use checksums
a3c1b7877da2d933e40afe7c5da29f6faad9879a724b0a240cc5694c609d89d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Release files / mirabox_n4pro-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mirabox_n4pro-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 665.4 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1df1319f4301fd9ca0d48cea4f2fd1aa3271127f5ee6f474f89ae1c09c726478
BLAKE2b-256 checksum
How to use checksums
ae410013ebb9e1dfe5ceb3d9c1d4153b5222c4c5b69c23cdf8bffb0e6a9694ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Release files / mirabox_n4pro-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL mirabox_n4pro-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 711.7 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
c25347de807aa42f86949cce47af425e912121fa34b40034c95da1ad642bbf87
BLAKE2b-256 checksum
How to use checksums
62367218c13b0d3812422fc828f2d98a8866ddc8de7f2a0271c6093303f77eb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Release files / mirabox_n4pro-0.1.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL mirabox_n4pro-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Size 603.5 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
aa3c82140fc6f71269ae7218ae05b9196d03adecac607bcb54884c6a62298cb5
BLAKE2b-256 checksum
How to use checksums
7d7a88d5fcfa3f8261373f2f3a043b0061d8f322750d4929521794915594e0e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Release files / mirabox_n4pro-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl

Download URL mirabox_n4pro-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl
Size 602.2 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
abf9b93f028e864eecb413d8fda01223d447716f2db73bddadc489f79d75b180
BLAKE2b-256 checksum
How to use checksums
61502235fe210d876895f9742fe1c24e646aba22ab3b83b76348248147ce019d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Security for mirabox-n4pro 0.1.1

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 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for mirabox_n4pro-0.1.1.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 Oct 26, 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.1.1 This release

6 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