Skip to main content

bakery

Bakes one slot's renders into the wall's mip chain, and serves it. A slot is one set of renders over the whole corpus; each item gets a 128px loose tile, and every item's 8px and 32px tiles are composed onto one sheet per level, with a JSON manifest beside each sheet.

It knows nothing about what the items are. brick-icons is the first host.

pip install pezlie
pip install 'pezlie[routes]'  # with the FastAPI routes

It needs resvg on PATH for SVG renders. The wall that draws what it bakes is pezlie on npm.

What a host supplies

  • The renders for a slotRender(id, path, sha) per item that has one. SVG goes through resvg; anything else is opened with Pillow.
  • The full order — every item id, drawn or not. A cell's index on a sheet is its position in this list, so the host must send the same order to compose and to the wall's feed, or every sprite lands off by one. compose refuses a list that repeats an id.
  • For the routes — a slot-name-to-directory lookup, a lookup naming the render file for an item in a slot, and the root those files must sit under.

What it promises

  • Ink, never ground. Tiles and sheets are transparent where there is no ink. The wall paints the ground.
  • One writer per slot. bake_item, compose and bake_slot hold a lock on <slot>/.bake.lock and raise BakeInProgress instead of interleaving.
  • Freshness by sha. An item whose sha matches baked.json, with tiles in the current format, is not rebaked. The manifest carries the sha map, so the wall can tell a stale cell from a fresh one.
from pezlie.batch import Render, bake_slot
bake_slot(renders, out="thumbs/occt", order=all_ids)

from pezlie.routes import render_router, thumbs_router
app.include_router(thumbs_router(slot_dir), prefix="/api/thumbs")
app.include_router(render_router(render_file, root, known_slot), prefix="/api/corpus/render")

Develop

Needs resvg on PATH.

uv venv bakery/.venv --python 3.14
uv pip install --python bakery/.venv/bin/python -e 'bakery[test]'
bakery/.venv/bin/python -m pytest bakery -q

tests/test_parity.py bakes the same inputs through brick-icons' brick_icons/thumbs.py and through this package and compares bytes. It looks for a brick-icons checkout beside pezlie, or at $BRICK_ICONS, and skips without one.

Download files

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

Source Distribution

pezlie-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

pezlie-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file pezlie-0.1.0.tar.gz.

File metadata

  • Download URL: pezlie-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for pezlie-0.1.0.tar.gz
Algorithm Hash digest
SHA256 167924cdd0daa8b66a4dae327650149378e6d5118bc7a73ad5bd2bda8a479d4f
MD5 25757dcb42f17b01a09cec102a1d521f
BLAKE2b-256 cf2273508ec5cc1677441f8febeb1f2b177cb80f296941ec6dbd542c552e3812

See more details on using hashes here.

File details

Details for the file pezlie-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pezlie-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for pezlie-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2161c38645f38fc0cff3e3eceb52484c2fbc56a3b6ce1a17a46252a1d60bc9b7
MD5 abb315e4ad6780f5a986fe63974bf71c
BLAKE2b-256 5939756302aee48cc61b90e98425ea33b89dbbb35a31a9bbe3e5aec5289d25f1

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.0 This release

2 files

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