Overview of htmy features
mainhtmy is an async, pure-Python server-side rendering engine designed to allow HTML generation using Python instead of a custom templating language.
Key Capabilities
- Async-first: Optimized for modern async tools and supports Async HTML streaming for improved Time to First Byte (TTFB).
- React-like Context: Supports context to avoid prop-drilling.
- Component Model: Supports both sync and async function components using decorator syntax.
- HTML/XML Support: Includes all baseline HTML tags, supports native HTML/XML documents with dynamic formatting, and provides slot rendering without custom syntax.
- Extensibility: Built-in support for Markdown, Jinja templates, and async JSON-based internationalization.
- Developer Experience: Fully-typed, unopinionated (works with any CSS/JS framework), and features automatic property-name conversion (snake_case to kebab-case).
- Error Handling: Includes a built-in
ErrorBoundarycomponent for graceful error management. - Compatibility: Works with Trio (via
AnyIO) and can wrap other templating libraries.