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 (free-threaded cp314t wheels are still niche) or a Rust toolchain to build from source. It builds and loads cleanly on free-threaded CPython (pyo3 0.25, no abi3, gil_used = false) — that is not a blocker, just packaging friction the pure-Python core avoids.

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.1.0.tar.gz (16.7 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.1.0-cp314-cp314t-win_amd64.whl (254.0 kB view details)

Uploaded CPython 3.14tWindows x86-64

taffylite-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl (356.8 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

taffylite-0.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl (325.8 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

taffylite-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl (314.0 kB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

taffylite-0.1.0-cp314-cp314-win_amd64.whl (255.3 kB view details)

Uploaded CPython 3.14Windows x86-64

taffylite-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl (357.3 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

taffylite-0.1.0-cp314-cp314-manylinux_2_28_aarch64.whl (326.4 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ ARM64

taffylite-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (315.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

taffylite-0.1.0-cp313-cp313-win_amd64.whl (255.3 kB view details)

Uploaded CPython 3.13Windows x86-64

taffylite-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl (357.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

taffylite-0.1.0-cp313-cp313-manylinux_2_28_aarch64.whl (326.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

taffylite-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (314.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for taffylite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45c151ce7024bd856e1b7b71b41228c651eef72da50c81b6bd36110bcb9835af
MD5 c6b90f04da43138f40fe7f38c537673b
BLAKE2b-256 5d30511fe4dc22c14e221570bc198655565667ae64b63b83cb7b78d354aea6ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.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.1.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: taffylite-0.1.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 254.0 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.1.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 9cab132790f1c6322c06f30ba2fe3d5ce7e701883580b9c82287c24cecea8681
MD5 13741058e8c427798b7f746f32109297
BLAKE2b-256 660a6e4568f1fced14a471602a0341d480740c7ce511a03e940ba0e092e9e8a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.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.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for taffylite-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3ebd1822851dce4c9a5eea2824ccb3f4cee69a18d7eefaa97f189f05a2784807
MD5 e0dce9585881570c30129245172485af
BLAKE2b-256 73a611283de7ad9ecd52f3fae61ce5611164c96222a65f26d886782f79c43f9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.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.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for taffylite-0.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5525b63c9bdddd726cd5a9835866742727ec371d781040668e20b7eeef29053c
MD5 cca0a468cc52cb4ef1bf906e07c82b76
BLAKE2b-256 68a377eea9665174555617305dc22f44bbdb45360c9fc9febbde95e541eb6069

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.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.1.0-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for taffylite-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c3aeef97b3c4c1500279fa7307e154f2a58b3b556f1a4d56c1524a6a7e75ae40
MD5 0176ad7216830d17d91a40a859ce58d9
BLAKE2b-256 d9152e00b552f1c5ce8a03fc6c4f0f67e4aa7bd2b8233c1c95db70d8800a0650

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.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.1.0-cp314-cp314-win_amd64.whl.

File metadata

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

File hashes

Hashes for taffylite-0.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 9dee2f6e7a3dff3556a50d312bca6bb183ac5603fc13076f0d6e94f1e9fe0c51
MD5 16c8622c6a41e84231cb8805b160681b
BLAKE2b-256 7ddd330fe4c0222d2d0ba947b4807e5317d9263c403cbe4345fa3738b9e79d88

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.0-cp314-cp314-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.1.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for taffylite-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 02d04a1ceb27605151b7de274cf5a774116b7dec60f4722f5c43e749ce4d1b2e
MD5 c49b28b847d97cbfd7a9d57baa0487d8
BLAKE2b-256 03125d271e69b8c8e65f28f070f7f0c38394c14530a5998ad204d80948de1f3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.0-cp314-cp314-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.1.0-cp314-cp314-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for taffylite-0.1.0-cp314-cp314-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0bb03b6685769de320466f5f062ec43ae94be80c619219589061ac2147510179
MD5 16af694e5d839df443ae552e07475bc7
BLAKE2b-256 5e9b1429c11060c4309fa7235697ab09680ac82ca14fff19c74dc103ff13f6ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.0-cp314-cp314-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.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for taffylite-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a6afd52995cf67cb7072951c5341161ed6543325b95aa83b0d85029c67d14e1
MD5 ff3ffada332e839c610b55bd26f6bcfc
BLAKE2b-256 bcce242c49e415c023de5f69065f3320e3fb13972536db9f3de7a6b578da40a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.0-cp314-cp314-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.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: taffylite-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 255.3 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.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 69c5deb84014d03425c731cc415a2004334fd5390fc0ef7fd0d7076db42d9bed
MD5 081e0b94bab634b5796298cc93172600
BLAKE2b-256 0d08ae3c9be970bd2deb1c95cf58de8c6ec6b4e945f21268f6be5f253be5b213

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.0-cp313-cp313-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.1.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for taffylite-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 403d9d8d58ad32704c29f243a894a0f16bf82ad840bca8e9e9c17852e87f94f6
MD5 ee7d068ad279111303bdb26c32b58927
BLAKE2b-256 b9bebab90e2dd9ab62d6c985b95508a67b7a4e5655e30a9a25e49e9701cdc612

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.0-cp313-cp313-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.1.0-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for taffylite-0.1.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7fa5978effe2d45e67ccf944dcb8daee79bdea94e55e613edf8791c82e6d81d4
MD5 9d60732847fa39d1a55df73bf691c0ef
BLAKE2b-256 b61928589ebb8cd25ce8bd88e5d1c7b18512bbfc3e21cefa3a605a78f3585a9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.0-cp313-cp313-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.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for taffylite-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ae0a506dc53524fc4987e4f8d4fe6e50b2834b14997b579951ef7a97c6df0c04
MD5 4e1da43a2a9f1bf9d4bfd021c3461032
BLAKE2b-256 945dfd10ce86a1b0fb4fabd5525900a45e13140b5a8cfc1ad54837e9f14afcef

See more details on using hashes here.

Provenance

The following attestation bundles were made for taffylite-0.1.0-cp313-cp313-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