Skip to main content

⏩ Shift: an experimental HTML renderer

username = 'Jane'
user_img = 'https://example.com/photo.jpg
todos = [
    "Invent new traffic lights",
    "Rehearse a movie scene",
    "Improve the spectrum technology",
]

html = shift(
    h1 >> t"{username}'s Todos",
    img @ {"src": user_img, "alt": username, "class": "photo"},
    ul >> (li >> todo for todo in todos),
    div >> (
        span @ {"class": "username"} >> username
        p >> "lots of long text, blah blah"
    ),
    defer(
        div >> t"Slow to load count: {lambda: click_count()}"
        loading=(div >> "Loading...")
    )
    button(hx_post="/clicked", hx_swap="outerHTML") >> "Click me"
)

Metadata

Release files for shifthtml 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shifthtml 0.1.0
File Size Uploaded
shifthtml-0.1.0.tar.gz 14.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shifthtml 0.1.0
File Interpreter ABI Platform
shifthtml-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.2 kB

Release files / shifthtml-0.1.0.tar.gz

Download URL shifthtml-0.1.0.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8054d350a9b063f79c4ae9203675793a065d00f58c8d19ec8884f6735f2f7943
BLAKE2b-256 checksum
How to use checksums
a7ade0fcd7ce6b9548a6c63a14d3abb91181b356d6cff219d1b170584cc2aaeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.11

Release files / shifthtml-0.1.0-py3-none-any.whl

Download URL shifthtml-0.1.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c42dcf2bab9d0c1a1f625fd4f5f272b69cc1de3628e221293afab588c89d03c
BLAKE2b-256 checksum
How to use checksums
97766f392dfaa325120e5d5b4d8b261ffef9ee74b52851d6e838379ddd0af8e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.11

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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