Canonical media-control vocabulary + Flipper-IRDB name→canonical mapping.
Project description
ir-canonical
A canonical media-control vocabulary and a Flipper-IRDB name → canonical
mapping, published as a small Python library so both the ESPHome codegen
(esphome-ir-codegen) and Concerto can resolve remote buttons semantically
instead of matching raw strings.
Why
Flipper-IRDB has no enforced button
naming — 54,415 distinct names over 301,921 occurrences. "Volume up" alone
appears as VOL+, Vol_up, VOLUME_UP, VOL_^, TV_Vol+, AMP_VOL+, … So you
cannot match a control by raw name.
Use it
pip install homeops-ir-canonical
from ir_canonical import resolve, canonical, MAP
resolve("VOL+") # -> "volume_up" (curated lookup, baked at build time)
resolve("TV_Power") # -> "power_toggle"
canonical("Ch_prev") # -> "channel_down" (rule engine; maps unseen spellings)
canonical("HDMI_1") # -> "input_hdmi_1"
MAP["vol+"] # the flat {alias: canonical} dict, lower-cased keys
resolve(name)— fast curated lookup via the bundled, human-maintainedcontrols/tree (compiled tocontrol_map.jsonat build time).canonical(name)— the broad rule-based engine; resolves spellings the curated tree hasn't enumerated yet, and the full vocabulary (not just the core).
Both are case-insensitive.
The curated controls tree (edit this by hand)
src/ir_canonical/controls/ is the human-owned source of truth for the core
controls that matter for driving activities (power / volume / channel / transport
/ navigation / digits / source — a curated subset):
src/ir_canonical/controls/
Volume_Up/aliases.json ["VOL+", "Vol_up", "VOLUME_UP", "AMP_VOL+", ...]
Power_Toggle/aliases.json ["POWER", "STANDBY", "TV_POWER", "PWR", ...]
...
Edit any aliases.json to prune or extend a control. The build bakes the tree
into control_map.json (so installs get an instant lookup); CI fails the build if
two controls claim the same alias.
Layout
| Path | What |
|---|---|
src/ir_canonical/normalize.py |
the rule-based canonical() engine + vocabulary |
src/ir_canonical/controls/ |
the curated tree (edit by hand) |
src/ir_canonical/compile.py |
tree → {alias: canonical} compiler |
hatch_build.py |
build hook that bakes control_map.json into the wheel |
seed.py |
dev tool: seed the tree + data/ reports from a Flipper-IRDB clone |
data/ |
full auto-derived map + unmapped tail (reference, not shipped) |
Develop
python -m build --wheel --no-isolation # build (bakes the map)
pip install dist/*.whl && pytest -q # test as a consumer
python seed.py /path/to/Flipper-IRDB-clone # re-seed the tree (won't clobber edits)
Release & publish
Versioning is managed by release-please
(Conventional Commits). Merging the release PR tags a GitHub Release, which triggers
publish.yaml to upload the wheel to PyPI via trusted publishing.
One-time PyPI setup: create the
homeops-ir-canonicalproject and add a trusted publisher → ownerHomeOps, repoir-canonical, workflowpublish.yaml, environmentpypi.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file homeops_ir_canonical-0.1.0.tar.gz.
File metadata
- Download URL: homeops_ir_canonical-0.1.0.tar.gz
- Upload date:
- Size: 241.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d613bb701b64dfd9354b87763c55ff2451b0e8f2fd83f88d794b698ef055108
|
|
| MD5 |
01370c0e0d3ce02068b72bf0466cb0fc
|
|
| BLAKE2b-256 |
b6d07d84168df1dde4ec08f033d2ad20d1f8aeaa31b511200e8c03f1319e11cb
|
Provenance
The following attestation bundles were made for homeops_ir_canonical-0.1.0.tar.gz:
Publisher:
publish.yaml on HomeOps/ir-canonical
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
homeops_ir_canonical-0.1.0.tar.gz -
Subject digest:
3d613bb701b64dfd9354b87763c55ff2451b0e8f2fd83f88d794b698ef055108 - Sigstore transparency entry: 1845890844
- Sigstore integration time:
-
Permalink:
HomeOps/ir-canonical@47a15bce517708e06573f09e48cf21f2a2cd6020 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HomeOps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@47a15bce517708e06573f09e48cf21f2a2cd6020 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file homeops_ir_canonical-0.1.0-py3-none-any.whl.
File metadata
- Download URL: homeops_ir_canonical-0.1.0-py3-none-any.whl
- Upload date:
- Size: 34.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e5103b6cb03f488052175c5c46ff9997fa49edc70632746105d5234b095e407
|
|
| MD5 |
cd881509a4c4f8d2912bc8fb0f65338e
|
|
| BLAKE2b-256 |
dd79505773d13859a7220dd808a4a521114d9a682038ed6ceac630f735385a86
|
Provenance
The following attestation bundles were made for homeops_ir_canonical-0.1.0-py3-none-any.whl:
Publisher:
publish.yaml on HomeOps/ir-canonical
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
homeops_ir_canonical-0.1.0-py3-none-any.whl -
Subject digest:
6e5103b6cb03f488052175c5c46ff9997fa49edc70632746105d5234b095e407 - Sigstore transparency entry: 1845890979
- Sigstore integration time:
-
Permalink:
HomeOps/ir-canonical@47a15bce517708e06573f09e48cf21f2a2cd6020 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HomeOps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@47a15bce517708e06573f09e48cf21f2a2cd6020 -
Trigger Event:
workflow_dispatch
-
Statement type: