Skip to main content

Brilliant Message Package

A Python package for handling rich application-level messages for Brilliant Labs Frame and Halo devices, including sprites, text, audio, IMU data, and photos.

Frame SDK documentation.

Examples on GitHub.

Installation

uv add brilliant-msg

Usage

import asyncio
from pathlib import Path

from brilliant_msg import BrilliantMsg, TxSprite

async def main():
    """
    Displays sample images on the Frame display.

    The images are indexed (palette) PNG images, in 2, 4, and 16 colors (that is, 1-, 2- and 4-bits-per-pixel).
    """
    frame = BrilliantMsg()
    try:
        await frame.connect()

        # Let the user know we're starting
        await frame.print_short_text('Loading...')

        # send the std lua files to Frame that handle data accumulation and sprite parsing
        await frame.upload_stdlua_libs(lib_names=['data', 'sprite'])

        # Send the main lua application from this project to Frame that will run the app
        await frame.upload_frame_app(local_filename="lua/sprite_frame_app.lua")

        # attach the print response handler so we can see stdout from Frame Lua print() statements
        frame.attach_print_response_handler()

        # "require" the main frame_app lua file to run it, and block until it has started.
        await frame.start_frame_app()

        # send the 1-bit image to Frame in chunks
        sprite = TxSprite.from_indexed_png_bytes(Path("images/logo_1bit.png").read_bytes())
        await frame.send_message(0x20, sprite.pack())

        # send a 2-bit image
        sprite = TxSprite.from_indexed_png_bytes(Path("images/street_2bit.png").read_bytes())
        await frame.send_message(0x20, sprite.pack())

        # send a 4-bit image
        sprite = TxSprite.from_indexed_png_bytes(Path("images/hotdog_4bit.png").read_bytes())
        await frame.send_message(0x20, sprite.pack())

        await asyncio.sleep(5.0)

        # unhook the print handler
        frame.detach_print_response_handler()

        # break out of the frame app loop and reboot Frame
        await frame.stop_frame_app()

    except Exception as e:
        print(f"An error occurred: {e}")
    finally:
        # clean disconnection
        await frame.disconnect()

if __name__ == "__main__":
    asyncio.run(main())

Running Tests

From the workspace root:

cd python
uv sync --all-packages --extra tests
uv run pytest packages/brilliant_msg/tests/

The test suite covers all Tx message packing (TxCode, TxPlainText, TxSpriteCoords, TxCaptureSettings, TxAutoExpSettings, TxSprite bit-packing and factory methods, TxImageSpriteBlock, TxTextSpriteBlock, TxTextPage with RectangularTextLayout and CircularTextLayout) and Rx message parsing (RxAudio WAV conversion, RxMeteringData, RxAutoExpResult, RxIMU including IMUData pitch/roll and SensorBuffer smoothing, RxTap, RxClick, thread-safe queue delivery from a non-loop thread, and BrilliantMsg handler dispatch). No hardware is required.

Metadata

Release files for brilliant-msg 7.3.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 brilliant-msg 7.3.0
File Size Uploaded Provenance Actions
brilliant_msg-7.3.0.tar.gz 56.4 kB Without provenance Details for brilliant_msg-7.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brilliant-msg 7.3.0
File Interpreter ABI Platform Actions
brilliant_msg-7.3.0-py3-none-any.whl Python 3 none any Details for brilliant_msg-7.3.0-py3-none-any.whl

Total release size: 114.5 kB

Release files / brilliant_msg-7.3.0.tar.gz

Download URL brilliant_msg-7.3.0.tar.gz
Size 56.4 kB
Tags Source
SHA-256 checksum
How to use checksums
45b0e3737e2632996828710588d5c9e87e90dd4dc8460ffcf98e28b81ff8bf02
BLAKE2b-256 checksum
How to use checksums
3599d3a0ad4362ea09199d2944842da04502a2df1c65b09b24f4bdc0ebea05c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / brilliant_msg-7.3.0-py3-none-any.whl

Download URL brilliant_msg-7.3.0-py3-none-any.whl
Size 58.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4839decf1cd39c6aa3f0a9df99598ecbfa9d86a83b846a38421b38cc1fe913da
BLAKE2b-256 checksum
How to use checksums
c07178ee4375f59b2c8c30bccecc8df7a2362640874af74c1db742ef5101832b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for brilliant-msg 7.3.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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