Skip to main content

taffylite

A deliberately thin PyO3 binding of the taffy flexbox layout engine, packaged as the optional layout engine behind saitenka's LayoutBackend seam (overlay/render/layout_backend.py, issue #146).

It is a fixed-size geometry solver: every leaf's width/height is supplied by the caller (Pillow has already measured the text on the Python side), so taffylite has no measure callback and no Rust-side cache — just a pure flexbox solve. Its one job is robustness: a mature CSS engine in place of hand-rolled offset arithmetic. Perf is a wash with the pure-Python default backend (both µs-scale, dominated by Pillow raster), so it is opt-in and parity-gated, never the default.

Why a Rust extension is opt-in

DefaultLayoutBackend (pure Python, zero-dependency) is always available and byte-identical. taffylite is additive: it needs a per-platform prebuilt wheel or a Rust toolchain to build from source. It builds and loads cleanly on free-threaded CPython (pyo3 0.29, gil_used = false) — that is not a blocker, just packaging friction the pure-Python core avoids.

Published on PyPI as three wheels per platform (pyo3 abi3 + abi3t, PEP 803): abi3 (GIL 3.13+), cp314t (free-threaded 3.14), abi3t (FT and GIL 3.15+), for Linux, macOS-arm64, and Windows — pull it via saitenka's extra, uv tool install 'saitenka[layout-engine]', or directly:

uv add taffylite     # or: pip install taffylite

API

import taffylite

# Row-stack geometry (the LayoutBackend.cumulative primitive):
starts, ends = taffylite.column(heights, gaps, top_pad)

# A generic fixed-size flex tree (used by the conformance fixtures):
t = taffylite.Tree()
a = t.add_leaf(width=40, height=20)
b = t.add_leaf(width=40, height=20)
root = t.add_flex([a, b], direction="column", gap=8, padding=(0, 12, 0, 0))
t.set_root(root)
rects = t.compute()  # [(x, y, w, h), …] index-aligned to handles

The measure-callback / Rust-cache design for the future intra-block text-layout track (taffy driving line wrap, calling back into Pillow) lives in the experiment/layout-engine-bakeoff worktree; it is out of scope here (a non-goal of #146) and intentionally not ported.

Licence

MIT OR Apache-2.0, matching taffy and pyo3. See LICENSE and NOTICE.

Download files

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

Source Distribution

taffylite-0.2.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distributions

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

taffylite-0.2.0-cp315-abi3.abi3t-win_amd64.whl (252.0 kB view details)

Uploaded CPython 3.15CPython 3.15+Windows x86-64

taffylite-0.2.0-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl (357.7 kB view details)

Uploaded CPython 3.15CPython 3.15+manylinux: glibc 2.28+ x86-64

taffylite-0.2.0-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl (325.0 kB view details)

Uploaded CPython 3.15CPython 3.15+manylinux: glibc 2.28+ ARM64

taffylite-0.2.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl (314.9 kB view details)

Uploaded CPython 3.15CPython 3.15+macOS 11.0+ ARM64

taffylite-0.2.0-cp314-cp314t-win_amd64.whl (250.6 kB view details)

Uploaded CPython 3.14tWindows x86-64

taffylite-0.2.0-cp314-cp314t-manylinux_2_28_x86_64.whl (356.2 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

taffylite-0.2.0-cp314-cp314t-manylinux_2_28_aarch64.whl (323.6 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

taffylite-0.2.0-cp314-cp314t-macosx_11_0_arm64.whl (312.5 kB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

taffylite-0.2.0-cp313-abi3-win_amd64.whl (250.2 kB view details)

Uploaded CPython 3.13+Windows x86-64

taffylite-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl (356.2 kB view details)

Uploaded CPython 3.13+manylinux: glibc 2.28+ x86-64

taffylite-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl (323.8 kB view details)

Uploaded CPython 3.13+manylinux: glibc 2.28+ ARM64

taffylite-0.2.0-cp313-abi3-macosx_11_0_arm64.whl (312.7 kB view details)

Uploaded CPython 3.13+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: taffylite-0.2.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for taffylite-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d472daeeee7a7f74451b498d41853d7f8febc89690096ce68378011c89191c8d
MD5 81a570190d3ada93b73369229b4a8d65
BLAKE2b-256 9559f0552da0aa81118f91ac21ff47cb840fd25d5946f61096bb98a870421c69

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0.tar.gz:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp315-abi3.abi3t-win_amd64.whl.

File metadata

  • Download URL: taffylite-0.2.0-cp315-abi3.abi3t-win_amd64.whl
  • Upload date:
  • Size: 252.0 kB
  • Tags: CPython 3.15, CPython 3.15+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for taffylite-0.2.0-cp315-abi3.abi3t-win_amd64.whl
Algorithm Hash digest
SHA256 b871594304767da4ac22718c8d1527d35cf5667967522a90c3ed40a8c8d27301
MD5 5d330d8de3466ef0ed4bc9a32bc4c9bb
BLAKE2b-256 981073b00311ca7414a5d51ae94b5be0d88f90913dacdb617e178f6e7e39bb34

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp315-abi3.abi3t-win_amd64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for taffylite-0.2.0-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 606ce942d1a2986d610eca1ed3bee4828b20e83253b8c780a5978e52cb584862
MD5 c0ffb85b97195d8636f39e5ef87d1b1e
BLAKE2b-256 7def5c7ee33d0ff22f63f34e4ee6eb9fdde9e9e3661355ffa4faed4f7c2ffb40

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for taffylite-0.2.0-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5b4d951174d7fdf13b58531226d27355411e95500f7abed7082e6e08c5668bf6
MD5 d6342b10900c26fe52646816c8e324b0
BLAKE2b-256 2e9b8fe39f0d4159508dc8e7f505b7e90a1cce2b60e8def71cbb69f53b30b941

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for taffylite-0.2.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3c7bee082aba6626b8ff8d518b8542bd55dc14e2898ff9ecb3dfe8c78fa41c2d
MD5 5b2a5eb0002db796ebe42984be7ca2d0
BLAKE2b-256 e4486b4c8f5db4bf52b287441887913316c6867ca9147c22721889b8b3165a26

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: taffylite-0.2.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 250.6 kB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for taffylite-0.2.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 c5e58790a3bd765def7a2ebbefd980de2b997026255e91fc1251741fac42169a
MD5 8012eca1556a0446b760f5859ddf525c
BLAKE2b-256 8ee0ab055d52db91eb716356a6a9dc2d383850b9710ebb0d652b5039d83f6362

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp314-cp314t-win_amd64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for taffylite-0.2.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f0f5f20b69a1665e8a55bea53f9cdd845cc6c1d2beebefb60fc08df476ebb659
MD5 66309f579da8b0df2cbc06825d804ff7
BLAKE2b-256 f7a1a3f6044c0ffda71a4eb056fafdfe405c5b1b91fee96ea1e78ff83b3bc48c

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp314-cp314t-manylinux_2_28_x86_64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for taffylite-0.2.0-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 69ba41ae39b90ead5e65020eb13dd4f6b7b00ec11a12c07426b2b9fce5ff5c29
MD5 fc2d487fc919828ecadbc9bec50455fc
BLAKE2b-256 562e81361245ed6b1889befc67d4b27e0a0ffce198a2e99591c17bbd7c18a236

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp314-cp314t-manylinux_2_28_aarch64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for taffylite-0.2.0-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4857a6a50d551cd45e961e742b7c54d165485647c6abd0bec13361df7c461e04
MD5 e0fbe693a375bed0b534c4f705e67ae9
BLAKE2b-256 946eedc4ab39066ce4b6360de9233fdaf094bb3771531c6e7c585121142630ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp313-abi3-win_amd64.whl.

File metadata

  • Download URL: taffylite-0.2.0-cp313-abi3-win_amd64.whl
  • Upload date:
  • Size: 250.2 kB
  • Tags: CPython 3.13+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for taffylite-0.2.0-cp313-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3b4328db8fa818af5e734d27f16200c4d968cad98a66c015d6627db2abec289d
MD5 e3e53747a96a8231aa52b39f22d0eec7
BLAKE2b-256 466abc6aa73e35ce37b4bd5adcdd41eda3f2c899a279197457af35b58ae0925c

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp313-abi3-win_amd64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for taffylite-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 62fad359565a8e1d5d7fc03dd4afaab5c275fc2e0747415a442bd5119a68b5af
MD5 a6610f7ce80fd20ddde0f7664d404b59
BLAKE2b-256 57cb49bd66cca1c42953d7b282dc16e54f52b49c24cb9dd8e88f4aef702018e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for taffylite-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a4d4b831f1fa6df4c9774771fbb2c6df75ed48beb89ac50b88f11dbed9a2aa6d
MD5 9a52ef7695cbde27fd1731622f9243d7
BLAKE2b-256 a2bad5d1272b20b6b95aa20d80c37d923cf40ce45e6612ca835380eb3b500355

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taffylite-0.2.0-cp313-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for taffylite-0.2.0-cp313-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 150a2d4a68a64c18205fe5b7171aec0d45b1620a48ca5d4e405f0d0b0f8864e9
MD5 2337c292e95c61e59a4bbab215f11fce
BLAKE2b-256 2736ea50f31ca590c649e9fae76bbcf5faf255da3762d4f61398866f3b35792b

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.2.0-cp313-abi3-macosx_11_0_arm64.whl:

Publisher: taffylite-release.yml on serjflint/saitenka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page