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
pip install 'pezlie[feed]'    # with pezlie.feed, which writes Arrow feeds

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.2.0.tar.gz (13.0 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.2.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pezlie-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7c823bcefbe33703841936167241705ca3f7dde46ff76e5db7dc62ca317d268a
MD5 369677d09e700581e1c6d02e5fe65d29
BLAKE2b-256 d95583b8dcfdd53fef15658baf434601a57113270c07090fa958c94b1a7d8464

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pezlie-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9dfac265c7d17b1ad5bf95a7f7c9a27606b36e337481c32aa3c96d024b3154c4
MD5 818a99ffbe8c5a73731da4b026df294a
BLAKE2b-256 1b6669658a30ed7bb67085840f17e9bdc9ed85b42f8f842198a7cde7e3656214

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

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