Generate pixel graphics for the Tidbyt
Project description
Indiepixel
Contributions more than welcome!
Basically… pixlet in Python.
Why?
This is an example for generating images for the Tidbyt device, a nice LED display. The company that made the Tidbyt got acquihired and won't be developing the software much in the future.
Pixlet was very convenient, but is an oddball for a tech stack: implemented in Go for people to consume in Starlark. Starlark is a niche language. It'd be nice to support a mainstream language.
This is a WIP implementation of the same concepts as pixlet in Python.
Getting started
First, install indiepixel with uv.
I use mise to manage my versions, so I'd start out with
mise install python uv
But that's optional if you have global installations of Python and uv that you like. Also: this process works without uv, with pip etc: if you're a Python expert, you can probably piece that together.
Initialize your project:
uv init
Then install indiepixel
uv add indiepixel
Create a basic example: for example, copy clock.py to the current directory.
Then run:
uv run indiepixel clock.py
Then, bam! You've got that clock rendering. If you want to get fancier,
you can create a directory of widgets and move clock.py into it, point
indiepixel at that, and it'll show all of them rendered in its web interface.
Deploying
I like to deploy this with Render but it's totally up to you. Again, Python experts probably can just figure this out, but with Render:
Set up Render to deploy from a repo containing your pyproject.toml and clock.py (or
whatever widgets you've written)
Render doesn't support uv and it's rough to install. So dump those dependencies into requirements.txt so the old-fashioned package managers can understand them:
uv pip freeze > requirements.txt
Your render start command will look like:
indiepixel src/clock.py
And add an environment variable like:
PYTHON_VERSION=3.13.2
To your environment so that it uses a modern version of Python.
Development
Environment setup
First make sure you have uv installed.
Install dependencies with:
uv sync
Install pre-commit hooks:
uv run pre-commit install
Running examples
To run examples/kitchen_sink.py:
uv run indiepixel examples/cli/gradient.py
Running tests
uv run pytest
Linting and formatting
uv run pre-commit run --all-files
Or run ruff directly
uv run ruff check
uv run ruff format --check
Publishing
This needs you to build before publishing:
- Bump version in pyproject.toml
uv builduv publish
Status
* = currently not tidbyt-compatible
- WebP generation
- Rendering the tb-8 pixel font without anti-aliasing
- Fonts
- Components
- Text
- Box*
- Rect*
- Column*
- Row
- Stack
- Circle
- PieChart
- Image
- Animation
- WrappedText
- Resizing
- Animation
- Plot
- 'expand' option
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 indiepixel-0.8.6.tar.gz.
File metadata
- Download URL: indiepixel-0.8.6.tar.gz
- Upload date:
- Size: 328.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b33b378efdebdde1ea9639959e8b9405e68a2b7f0d274760c89b0bea906d90d1
|
|
| MD5 |
776138c2e309705b574a5557144b1fb0
|
|
| BLAKE2b-256 |
15bb19d7716c775803dc27531bb41b07d8cee73dd07e916c1a545bd8b6205336
|
File details
Details for the file indiepixel-0.8.6-py3-none-any.whl.
File metadata
- Download URL: indiepixel-0.8.6-py3-none-any.whl
- Upload date:
- Size: 316.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e840169538e37c1d3cc9675182011ec18568191a80ce0331bdee75896327dc35
|
|
| MD5 |
93d33a22a13403d8d42810a90cb75783
|
|
| BLAKE2b-256 |
44a913ce354e7c25f08c08a95d6d00522e16d5459a7ae3d1947e521e9d7fb510
|