--- id: hyperscript version: "0.3.0" license: MIT License license_treatment: permissive maintenance: dormant --- # hyperscript — HyperText with Python License: permissive · Maintenance: dormant · Downloads: 511.8K/mo ## What it is and what it does Hyperscript is a lightweight Python library for building HTML markup using function calls rather than string concatenation or templates. You pass an element selector (tag name, optional class and id), attributes as a dictionary, and content as positional arguments, and it returns an HTML string. It supports nested elements, inline styles, boolean attributes, and class/id shorthand syntax similar to CSS selectors. The library has no runtime dependencies and installs cleanly on Python 3.8+. It is dormant—the repository is not archived but has seen no commits since late 2024 and no releases in several months—so it is stable but not actively developed. It carries no known security vulnerabilities and is licensed under MIT, making it safe to use in most projects. Use it for: - Generate HTML snippets programmatically in web frameworks or static site generators without writing raw HTML strings. - Build email templates or HTML reports dynamically from Python data structures. - Create test fixtures or mock HTML for unit tests without external template files. - Construct simple HTML documents or fragments in CLI tools or data processing scripts. - Prototype web page layouts in Jupyter notebooks or interactive Python environments. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Hyperscript lets you generate HTML markup programmatically using Python function calls instead of writing HTML strings directly. Yes, if you need lightweight programmatic HTML generation without template overhead. The package is stable, dependency-free, and permissively licensed. However, it is dormant—no active maintenance—so use it only for straightforward markup tasks where you do not expect ongoing support or feature additions. For complex templating or large-scale web applications, consider a maintained alternative. ## Install pip install hyperscript uv add hyperscript poetry add hyperscript ## Installing hyperscript Before you install: Installation is straightforward with no runtime dependencies. The package is dormant—last commit was 2024-12-21 and no release since 2024-10-22—so expect no active maintenance or rapid bug fixes. License in practice: MIT License is permissive, allowing commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you retain the license notice. Quickstart: pip install hyperscript from hyperscript import h print(h("p.greeting#msg", "Hello world!")) Requires Python 3.8 or later. Verify before relying: - Whether the package handles edge cases in attribute rendering (e.g., data attributes, custom namespaces) beyond the documented examples. - Performance characteristics when generating large or deeply nested HTML structures. - Whether there is a way to output formatted/pretty-printed HTML or only minified output. ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 511.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python html generation, write html with python, html builder library, programmatic markup generation, html dsl python, dom creation python, html templating alternative, html-generation, markup-builder [View on SkillFed](https://skillfed.io/packages/hyperscript) · [View on PyPI](https://pypi.org/project/hyperscript/)