CheerLights API Python Package
A Python package to interact with the CheerLights API. It allows users to get the current CheerLights color, retrieve the color history, and perform various color-related utilities.
Installation
You can install the package using pip:
pip install cheerlights_api
Usage Examples
import cheerlights_api
# Get the current color name and hex code
current_color = cheerlights_api.get_current_color()
print(current_color) # Example: {'color': 'red', 'hex': '#FF0000'}
# Get the current color name
color_name = cheerlights_api.get_current_color_name()
print(color_name) # Example: 'red'
# Get the current hex code
hex_code = cheerlights_api.get_current_hex()
print(hex_code) # Example: '#FF0000'
# Get the history of colors
history = cheerlights_api.get_color_history(5)
for entry in history:
print(f"{entry['timestamp']}: {entry['color']} ({entry['hex']})")
# Convert a color name to hex
hex_code = cheerlights_api.color_name_to_hex('green')
print(hex_code) # '#00FF00'
# Convert hex code to RGB
rgb = cheerlights_api.hex_to_rgb('#00FF00')
print(rgb) # (0, 255, 0)
# Check if a color is valid
is_valid = cheerlights_api.is_valid_color('purple')
print(is_valid) # True
Release files for cheerlights-api 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cheerlights_api-0.1.2.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cheerlights_api-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / cheerlights_api-0.1.2.tar.gz
| Download URL | cheerlights_api-0.1.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff6c57d5481c05d034bc85c4d2f5a7e8463db8ef67381c0e3e7bb0b0353dd0c6
|
|
BLAKE2b-256 checksum How to use checksums |
9e37e7c14e667d2e4917aa188dad3a03190746ca9830b5efc231345aa8a70041
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / cheerlights_api-0.1.2-py3-none-any.whl
| Download URL | cheerlights_api-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2160fd3d6edf1c56c6fdda62d06f756ec33f974fd7a1afebca8b8e0d5d099353
|
|
BLAKE2b-256 checksum How to use checksums |
dcb75939cd0c06436ff52d6fd5e796404688cb0b2114a1f6da8aa409920f2e0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|