Layout library for Python (based on Taffy, a rust-powered implementation of CSS Grid/Flexbox)
Project description
stretchable
stretchable is a layout library for Python that enables context-agnostic layout operations using CSS Grid and Flexbox. Possible uses include UI layouts, page layouts for reports, complex plotting layouts, etc.
It implements Python bindings for Taffy, an implementation of Grid/Flexbox written in Rust. It was originally based on Stretch (hence the name), but has since migrated to use Taffy.
Getting Started
Helpful resources to getting started with layouts using CSS Grid and Flexbox are listed below.
Flexbox
- Flexbox Froggy. This is an interactive tutorial/game that allows you to learn the essential parts of Flexbox in a fun engaging way.
- A Complete Guide To Flexbox by CSS Tricks. This is detailed guide with illustrations and comprehensive written explanation of the different Flexbox properties and how they work.
- Yoga Playground
CSS Grid
- CSS Grid Garden. This is an interactive tutorial/game that allows you to learn the essential parts of CSS Grid in a fun engaging way.
- A Complete Guide To CSS Grid by CSS Tricks. This is detailed guide with illustrations and comphrehensive written explanation of the different CSS Grid properties and how they work.
Usage
See demos for examples of basic usage.
Contribute
Contributions are welcomed. Please open an issue to clarify/plan implementation details prior to starting the work.
Building
Install Rust with rustup and use maturin develop
for development and maturin build [--release]
to build.
Testing
Install test dependencies and invoke pytest
. Note that there are ~450 tests, the majority of which are run using Selenium with the Chrome WebDriver, and the complete test suite can take ~10 minutes to complete. Use pytest --lf
to only run the last-failed tests.
License
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for stretchable-1.0.0b3-cp38-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 550da487b268da09152283dc05d24a00f40e67c3e1a47ded36e2e1213ea04963 |
|
MD5 | f7e2833b747aa792e485387d871479d6 |
|
BLAKE2b-256 | f46370ba4fea1a46136f4cdf68e3d1fa5d578cc847f91ff07f3c82cfe61f988c |
Hashes for stretchable-1.0.0b3-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77eb79fae8a4c61f47ddefe379da56a2e02c60432e0006cb3db1b064028404b8 |
|
MD5 | 0f462f75dc32c41879b66d10181d2e72 |
|
BLAKE2b-256 | ad18c22c0a03a28226ea1c022fcda698354b66678efadc68b5392c403d4b19d2 |
Hashes for stretchable-1.0.0b3-cp38-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef6859f6ac90f46d7b9fc70807ff409bfa46686d126e1a49fad919e2ca8adca8 |
|
MD5 | 7baf0fdc2f3115c7a01d7094e516e722 |
|
BLAKE2b-256 | 85ade1d1f5a76ee1443fac357654bb794a617a540562cc4d13b74c45c84ec740 |
Hashes for stretchable-1.0.0b3-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 920301830f4eb41dc2be0c9ad2e2c531e6454f2512021d79e7bed8d1d39257ff |
|
MD5 | a34b5ac93c338d46316d159f2df4cf16 |
|
BLAKE2b-256 | 1e865c2912e330d9a18d41d4320c28abbd084cb6d54225947b34a2cf0c0d0d09 |
Hashes for stretchable-1.0.0b3-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e55a552bf20663ff15cc36d1dde09414953730c3e5a7d03587ce6d58f0f1ffa2 |
|
MD5 | bf78844ccde775547eaeabc3c1d3bf72 |
|
BLAKE2b-256 | 3720a41fdc45bfc062a0208951156c6a4faeaa7a4caf7e6fa9220f48b65292e1 |
Hashes for stretchable-1.0.0b3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8a19428a67c7eb136e65aaf5320502608143426d753a9c13a638dd305413936 |
|
MD5 | a41a4e7f68241db4fcd8dd3121285c15 |
|
BLAKE2b-256 | 5bd59d833da955ea359b312d140291e54dd2ca1a77461eae69d7dbd3fbe449c0 |
Hashes for stretchable-1.0.0b3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac8ae69cfcecd72d7a7594037a92ff611410dd199f4d343acb32c4805a3135dc |
|
MD5 | 44bfd700ae1d9f452abb4e7c401f1186 |
|
BLAKE2b-256 | 91ce2136f4c544a76dff9f0c26931a56b5f59c814bd5034d527d8b7750698ff6 |
Hashes for stretchable-1.0.0b3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71539f73144dabc4dc2b2f2126c5c8bc5fc00ca254a746a9baf998f06680b871 |
|
MD5 | 360982b334f78aad5c04396ef0a46fba |
|
BLAKE2b-256 | 51bc8065e8c640db6ba358084fd170422f335ca795ec0e5aa70e875c722097f7 |
Hashes for stretchable-1.0.0b3-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c785a848450bc9047b3ecf6e1d1f6ca7c3df6081537f5cf7100749162ca1ae34 |
|
MD5 | 25d18ba208bda3c6c946122c714f1cbc |
|
BLAKE2b-256 | 6f30339bab445a529bcc0c6f19a7d5cae31e43fc5e8b30f3d827ea35e55042ae |