Hypercolor Python
Async Python client and WebSocket helpers for the Hypercolor daemon.
This package lives inside the main Hypercolor repository at python/. It is a
standalone uv project, so Python contributors can work here without touching the
Rust workspace.
Generation details live in ../docs/development/CLIENT_GENERATION.md.
Install
The client is published to PyPI as hypercolor
(alpha):
uv add hypercolor
For development inside this repository:
uv sync
Quick Start
import asyncio
from hypercolor import HypercolorClient
async def main() -> None:
async with HypercolorClient() as client:
status = await client.get_status()
devices = await client.get_devices()
print(status.running)
print([device.name for device in devices])
asyncio.run(main())
The async client is the primary API. Use SyncHypercolorClient for scripts or
small tools that are not already running an event loop.
from hypercolor import SyncHypercolorClient
with SyncHypercolorClient() as client:
print(client.get_status().global_brightness)
Drivers
Driver inventory includes module capabilities, config keys, optional control surface paths, and protocol catalogs for HAL-backed modules.
import asyncio
from hypercolor import HypercolorClient
async def main() -> None:
async with HypercolorClient() as client:
for driver in await client.get_drivers():
if driver.descriptor.capabilities.protocol_catalog:
print(driver.descriptor.display_name)
print([protocol.display_name for protocol in driver.protocols])
asyncio.run(main())
Effects
import asyncio
from hypercolor import HypercolorClient
async def main() -> None:
async with HypercolorClient() as client:
effects = await client.get_effects()
borealis = next(effect for effect in effects if effect.name == "Borealis")
await client.apply_effect(
borealis.id,
controls={"speed": 5, "palette": "SilkCircuit"},
transition="cut",
)
asyncio.run(main())
Control Surfaces
Control surfaces are dynamic device and driver settings. Request helpers accept normal Python values and return the canonical API resource contracts.
import asyncio
from hypercolor import HypercolorClient
async def main() -> None:
async with HypercolorClient() as client:
surface = await client.get_device_controls("keyboard")
await client.set_control_values(
surface.surface_id,
{
"enabled": True,
"brightness": 0.88,
},
)
await client.invoke_control_action(
surface.surface_id,
"identify",
{"duration_ms": 750},
)
asyncio.run(main())
Inside an async function, typed daemon values can pass through directly:
async with HypercolorClient() as client:
await client.set_control_values(
"device:keyboard",
{"accent": {"kind": "color_rgb", "value": [128, 255, 234]}},
)
WebSocket Events
import asyncio
from hypercolor import HypercolorClient
from hypercolor.websocket import EventMessage, MetricsMessage
async def main() -> None:
async with HypercolorClient() as client:
async with client.events() as stream:
await stream.subscribe("events", "metrics")
async for message in stream:
if isinstance(message, EventMessage):
print(message.event, message.data)
elif isinstance(message, MetricsMessage):
print(message.data)
asyncio.run(main())
Binary frame, spectrum, and canvas messages are decoded into dataclasses, so callers do not need to parse the wire format.
Development
Use the local recipes from python/:
just verify
just fix
just generate
just generate-check
The full project recipe also runs the Python gate:
just python-verify
Manual equivalents:
uv run ruff check .
uv run ruff format --check .
uv run ty check
uv run python scripts/generate_ws_protocol.py --check
uv run pytest
uv run python scripts/generate_openapi_client.py --check
Metadata
Release files for hypercolor 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 | |
|---|---|---|---|
| hypercolor-0.5.0.tar.gz | 276.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hypercolor-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / hypercolor-0.5.0.tar.gz
| Download URL | hypercolor-0.5.0.tar.gz |
|---|---|
| Size | 276.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53edaac22b663af9aed5c6a2f989f6a1b932c980b2077faed65431693fa0cb80
|
|
BLAKE2b-256 checksum How to use checksums |
447b192477c85a4045de7350f502ecd9db0192ce466f10d17d50d70f55c42ba4
|
| 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 8, 2026.
Transparency logRelease files / hypercolor-0.5.0-py3-none-any.whl
| Download URL | hypercolor-0.5.0-py3-none-any.whl |
|---|---|
| Size | 775.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef3b21fb82d8213a1e0a57fb4258fe657400a32af61d7372bcb7c64723c68b31
|
|
BLAKE2b-256 checksum How to use checksums |
85f3c8c2bda975e08a6c8606980b232466531d4819b9e75ceceeabe039957cde
|
| 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 8, 2026.
Transparency log