{"library":"stretchable","title":"Stretchable","type":"library","description":"A Python layout library that uses Taffy, a Rust-powered implementation of CSS Grid and Flexbox, to compute layouts declaratively. Current version is 1.1.8, supporting Python >=3.8. Release cadence is irregular, approximately bi-monthly.","language":"python","status":"active","last_verified":"Sat May 09","install":{"commands":["pip install stretchable"],"cli":null},"imports":["from stretchable import Auto","from stretchable import Node","from stretchable import LayoutTree","from stretchable import Style","from stretchable import Layout"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://stretchable.readthedocs.io/en/latest/","github":"https://github.com/mortencombat/stretchable","docs":"https://stretchable.readthedocs.io/en/latest/","changelog":null,"pypi":"https://pypi.org/project/stretchable/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"from stretchable import Node, LayoutTree, Style\n\n# Create a root node with flexbox layout\nroot = Node(style=Style(size={\"width\": 100, \"height\": 100}, display=\"flex\", flex_direction=\"column\", gap=10))\nchild1 = Node(style=Style(size={\"width\": 50, \"height\": 30}))\nchild2 = Node(style=Style(size={\"width\": 50, \"height\": 30}))\n\n# Build and compute layout\ntree = LayoutTree(root)\nroot.add_child(child1)\nroot.add_child(child2)\ntree.compute_layout()\n\n# Print layout of child1\nlayout = tree.get_layout(child1)\nprint(f\"Child1: left={layout.left}, top={layout.top}, width={layout.width}, height={layout.height}\")","lang":"python","description":"Quickstart: create nodes, add children, compute layout, and access results.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}