{"categories":[{"label":"HTML","url":"https://skillfed.io/packages/category/text-processing-markup-html"}],"enrichment":{"capability":"htpy lets you write HTML directly in Python using bracket syntax and Python expressions, generating valid HTML without a template language.","skillfed_tags":["html-generation","type-safe","async-ready"],"use_cases":["Build server-rendered HTML components for htmx-driven interfaces without switching to a template language.","Generate complex, nested HTML structures in Flask or Django views using Python functions and comprehensions.","Type-check your HTML generation code with mypy or pyright to catch structural errors early.","Render HTML asynchronously in FastAPI or Starlette applications with full async/await support.","Create reusable HTML components as Python functions or classes that compose like regular code."],"what_it_does":"htpy is a Python library for generating HTML without templates. Instead of writing HTML strings or using a template language, you define HTML elements and structure using Python syntax\u2014nesting child elements with brackets, passing attributes as function arguments, and composing components as regular Python functions or variables. It relies on markupsafe for safe HTML escaping and typing_extensions for type hints.\n\nThe library is designed to work with any Python web framework (Django, Flask, etc.) and supports async rendering for ASGI frameworks. Because HTML is just Python code, you can use static type checking with mypy or pyright, debug with standard Python debuggers, and leverage Python's full feature set\u2014functions, classes, comprehensions, conditionals\u2014to organize and reuse components. It was created to avoid the friction of template languages while maintaining the familiarity of Python development.","worth_installing":"Yes. htpy is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive MIT license. It is well-suited if you prefer writing HTML in Python over templates and want static typing and debugging support. Not necessary if you are already satisfied with your templating approach or need Python versions below 3.10."},"id":"htpy","links":{"html":"https://skillfed.io/packages/htpy","md":"https://skillfed.io/packages/htpy.md","pypi":"https://pypi.org/project/htpy/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-22","license_spdx":"MIT","license_treatment":"permissive","name":"htpy","python_support":"supports_current","summary":"htpy - HTML in Python"},"popularity":{"monthly_downloads":206954,"position":9561,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"26.5.1"}
