Skip to main content

moodface

PyPI PyPI Downloads Tests

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.

Five characters × four stress levels

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; one face.yaml fits 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.yaml plus PNGs; moodface validate catches 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]

The built-in layouts

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:

Taiwan scenes on a band, a square watch and a round watch

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 — .bin files are produced by compile.exe, a closed-source compiler distributed with Mi Create. moodface downloads it only when you run moodface 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.20261119.1212808

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moodface 1.20261119.1212808
File Size Uploaded Provenance Actions
moodface-1.20261119.1212808.tar.gz 826.9 kB With provenance Details for moodface-1.20261119.1212808.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for moodface 1.20261119.1212808
File Interpreter ABI Platform Actions
moodface-1.20261119.1212808-py3-none-any.whl Python 3 none any Details for moodface-1.20261119.1212808-py3-none-any.whl

Total release size: 1.7 MB

Release files / moodface-1.20261119.1212808.tar.gz

Download URL moodface-1.20261119.1212808.tar.gz
Size 826.9 kB
Tags Source
SHA-256 checksum
How to use checksums
88aa8a8da2578b64c49a472b162d606d75abdf586c275ec8867bf160ae5c95ea
BLAKE2b-256 checksum
How to use checksums
5de8accbce7b0fde03ea5f90babd626d8e0cd6d89541d3afcb1cd5d3e5b98b40
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 19, 2026.

Transparency log

Release files / moodface-1.20261119.1212808-py3-none-any.whl

Download URL moodface-1.20261119.1212808-py3-none-any.whl
Size 841.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03f3856ca34ae1df710227622b2384094fa32c830fdfdb8ec8b22477898d5503
BLAKE2b-256 checksum
How to use checksums
2815f0037722f88da8847f1b388c199510eebd0569b34d10f087b70cb606e06b
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 19, 2026.

Transparency log

Security for moodface 1.20261119.1212808

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.

Select from 2 files

Attestation for moodface-1.20261119.1212808.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 19, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page