moodface
Animated watch faces for Xiaomi smart bands and watches that react to your all-day stress level — the character, background and caption change as your stress goes up or down. The same rules drive faces that follow the time of day, the season, the weekday, battery or heart rate.
| Bun | Cat | Sprout | Cloud | Idol |
|---|---|---|---|---|
| steams up under stress | fur puffs up | blooms when calm | storms when stressed | sparkles when calm |
Status: alpha. Faces build for 16 bands and watches; testing on real devices is still in progress.
Features
- 😌 Stress-driven — four stress levels, each with its own picture, animation and caption
- 🌸 Rules — switch by
season,time_of_day,weekday, battery, heart rate, any threshold or range ("22-5"wraps past midnight) - 🧱 Layouts —
classic,scene,corner,big-time,stats,minimal,photo; oneface.yamlfits bands, square and round watches - 🔢 Generated text — time, dates, weekday badges, labels and Traditional Chinese captions rendered from OFL fonts
- 🎞️ Previews — GIFs for every state, a simulated day and year, before you build anything
- 📄 Declarative — a
face.yamlplus PNGs;moodface validatecatches problems early
Installation
pip install moodface
Previews need nothing else. Building a .bin also needs Docker (Docker Desktop on macOS / Windows) and a third-party compiler (see Third-party), which always runs inside a container so it never touches your system:
moodface compiler setup # asks before downloading
moodface compiler status
Quick start
EX=$(python -c "import moodface, pathlib; print(pathlib.Path(moodface.__file__).parent / 'examples')")
moodface preview $EX/classic_bun -o bun_preview # overview.png, stress_*.gif, day.gif
moodface build $EX/classic_bun -o bun_build # bun_build/classic_bun.bin
moodface build $EX/classic_bun --device watchs4 # the same face for a round watch
A face is a folder with a face.yaml and its pictures:
name: my_bun
device: band9 # moodface devices
layout: classic # moodface layouts
slots:
character:
source: stress_level # calm / normal / medium / high
images: {calm: assets/calm.png, normal: assets/normal.png, medium: assets/medium.png, high: assets/high.png}
caption:
texts: {calm: 熱呼呼,好放鬆~, normal: 剛出爐,狀態不錯!, medium: 蒸氣有點多,深呼吸, high: 快蒸爆了,休息一下}
stats: [stress, steps, heart_rate]
Layouts, rules, widgets, the device list and all examples are in the reference.
A day around Taiwan
The taiwan_scenes example fills the screen with a scene that follows the hour — Alishan sunrise, Sun Moon Lake, Jiufen and Taipei 101 — with the steamed bun showing your stress in the card:
Draw your own character
examples/draw_bun.py is a self-contained example (Pillow only) that draws the bun in four moods and writes a face.yaml:
python examples/draw_bun.py my_bun
moodface preview my_bun
moodface build my_bun
Replace draw_bun() with your own drawing — or any PNGs with the same names — and moodface handles the layout, digits, captions and switching.
Install the resulting .bin with a tool that supports custom watch faces for your device.
Use with Claude Code
moodface init --workspace my_faces # or `moodface init` in the current folder
cd my_faces && claude
init adds a moodface skill (.claude/skills/moodface/SKILL.md), a short CLAUDE.md, the Dockerfile the compiler runs in, and an example face, so you can ask Claude Code for a face in plain words — it writes the face.yaml, draws the pictures, checks the previews and builds the .bin. Use --device watchs4 (or any key from moodface devices) to set the default device.
Development
pip install -e .
python -m unittest discover -s tests -v
The version lives in src/moodface/_version.py and follows 1.YYYYmmdd.1HHmmss. Bump it, commit, and publish a GitHub Release with the same tag; the Upload Python Package workflow tests, builds and publishes to PyPI.
Third-party
- Compiler —
.binfiles are produced bycompile.exe, a closed-source compiler distributed with Mi Create. moodface downloads it only when you runmoodface compiler setup, runs it in a Docker container and never redistributes it. - Fonts — no fonts ship with moodface. Nunito and Noto Sans TC (SIL Open Font License) are downloaded from Google Fonts on first use (
moodface fonts setup), or pass your own with--font/--text-font.
Artwork and disclaimer
The characters and scenes in the examples are original artwork made for this project and ship as PNG files under the MIT license; no photos or third-party characters are used. moodface is an unofficial project, not affiliated with or endorsed by Xiaomi. Installing custom watch faces is at your own risk.
License
MIT
Metadata
Release files for moodface 1.20261127.1205738
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| moodface-1.20261127.1205738.tar.gz | 827.9 kB | With provenance | Details for moodface-1.20261127.1205738.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moodface-1.20261127.1205738-py3-none-any.whl | Python 3 | none | any | Details for moodface-1.20261127.1205738-py3-none-any.whl |
Total release size: 1.7 MB
Release files / moodface-1.20261127.1205738.tar.gz
| Download URL | moodface-1.20261127.1205738.tar.gz |
|---|---|
| Size | 827.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f0cb6d0117369012b95dcb51c1581d2e1e907ef30ce6a33b8189de7e56faead
|
|
BLAKE2b-256 checksum How to use checksums |
afe914136ef95305a30a19e0e9434d64139858de56dc3e12d4f6c6b2317a827e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 27, 2026.
Transparency logRelease files / moodface-1.20261127.1205738-py3-none-any.whl
| Download URL | moodface-1.20261127.1205738-py3-none-any.whl |
|---|---|
| Size | 842.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddc1da5c2645ba72b6b05446d14a665f0d1d9be512ab8599ecbca3b320c5228f
|
|
BLAKE2b-256 checksum How to use checksums |
ea2b7eeb5683c90904fc3bbb3d3ad713aed460ed508e5aeb2a8be89cd7cbd296
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 27, 2026.
Transparency logSecurity for moodface 1.20261127.1205738
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for moodface-1.20261127.1205738.tar.gz
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 Nov 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.