Skip to main content

Create and manipulate WPS tags from Python

Project description

python-rockbox

Create and manipulate WPS tags from Python

Currently supported:

  • All tags from Rockbox 4.0 (via Tags class)
  • Tags (Tag class)
  • Rockbox formatted hex color (Color class)
  • Conditionals (Match class)
  • If statements (If class)

Examples

This conditional that displays an appropriate battery bitmap:

wps = Match(
    Tags.IS_CHARGING,
    [
        Tag(Tags.DISPLAY_IMAGE, "A"),
        Match(
            Tags.BATTERY_PERCENTAGE,
            [
                Tag(Tags.DISPLAY_IMAGE, "B"),
                Tag(Tags.DISPLAY_IMAGE, "C"),
                Tag(Tags.DISPLAY_IMAGE, "D"),
                Tag(Tags.DISPLAY_IMAGE, "E"),
                Tag(Tags.DISPLAY_IMAGE, "F"),
            ],
        ),
    ],
)

Would __repr__ to:

%?bp<%xd(A)|%?bl<%xd(B)|%xd(C)|%xd(D)|%xd(E)|%xd(F)>>

This if statement:

wps = If(Tags.VOLUME, ">=", 0, [
    "Clipping possible",
    "Volume OK"
])

Would __repr__ to:

%?if(%pv, >=, 0)<Clipping possible|Volume OK>

Install

To install locally, make sure you have the following installed:

  • A modern version of Python 3 (I target 3.14)
  • git
  • pip

First, clone the repository:

git clone https://git.0stormy.xyz/stormy/python-rockbox.git

Next, change directories into the folder you just cloned:

cd python-rockbox

Finally, install it locally with:

pip install -e .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_rockbox-0.2.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_rockbox-0.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file python_rockbox-0.2.0.tar.gz.

File metadata

  • Download URL: python_rockbox-0.2.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for python_rockbox-0.2.0.tar.gz
Algorithm Hash digest
SHA256 29839997e366a7ef9b313c7916254e109e9093afeb3812bb4c9d0378964dd4b8
MD5 1330750ed1c13973b64ea2ad77c86618
BLAKE2b-256 3f6a1180b86c39a268b82b63abee42dc0a97aa0428dc218474fcb68a9458f659

See more details on using hashes here.

File details

Details for the file python_rockbox-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: python_rockbox-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for python_rockbox-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1dad9a2a7d5cb1640f92554ecaf6f7bea93d6b3632f07ddf53c735ce04938e34
MD5 fec82b5d5b81d12f1c570ecc9d5110cc
BLAKE2b-256 6b1c41b6f90a55bc7a3c382e4cc52aeb1ecffa70feea3ce0b83a39886bc8ea00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page