# Kida > Modern template engine for Python 3.14t — AST-native, free-threading ready ## Overview - [Kida](/kida/): A Python template engine and Jinja2 alternative for HTML templates, streaming, and framework integration - [Llms](/kida/llms/) ## Documentation - [Documentation](/kida/docs/): Documentation for the Kida Python template engine, including syntax, streaming, and Jinja2 migration - [Error Codes](/kida/docs/errors/): Reference for all Kida error codes with descriptions and fixes ## Releases - [Kida 0.1.0](/kida/releases/0.1.0/): Initial public release - [Kida 0.1.1](/kida/releases/0.1.1/): __html__ protocol support - [Kida 0.1.2](/kida/releases/0.1.2/): RenderContext isolation and profiling - [Kida 0.2.0](/kida/releases/0.2.0/): Streaming rendering, async streaming, four new loaders, static analysis API, and better error messages - [Kida 0.2.1](/kida/releases/0.2.1/): Dead code elimination and filter partial evaluation - [Kida 0.2.2](/kida/releases/0.2.2/): Named call slots, slot-aware analysis, and circular macro import detection - [Kida 0.2.3](/kida/releases/0.2.3/): Flush directive, security hardening, K-RUN-007 fix, and resource guards - [Kida 0.2.4](/kida/releases/0.2.4/): Composition API, inherited blocks, slot context inheritance, string concatenation - [Kida 0.2.5](/kida/releases/0.2.5/): render_block performance, filter modularization, polymorphic + fix, release automation - [Kida 0.2.6](/kida/releases/0.2.6/): Regions, render_block def scope, top-level defs in blocks, framework integration docs - [Kida 0.2.7](/kida/releases/0.2.7/): Fail-fast filter errors, typeof, nested slot passthrough fixes, and clearer runtime suggestions - [Kida 0.2.8](/kida/releases/0.2.8/): Yield directive, render-path performance, region defaults, and imported macro namespaces - [Kida 0.2.9](/kida/releases/0.2.9/): kida check CLI, render_block import fixes, compiler optimizations, benchmark refresh - [Kida 0.3.0](/kida/releases/0.3.0/): Terminal rendering mode, framework integrations, sandbox, coverage, a11y linting, formatter, extensions ## About - [About](/kida/docs/about/): Architecture, performance, comparisons, and design philosophy for the Kida Python template engine - [Architecture](/kida/docs/about/architecture/): How Kida works internally - [Kida Syntax and Features](/kida/docs/about/comparison/): How Kida compares to Jinja2-style template engines and when it fits best - [The Bengal Ecosystem](/kida/docs/about/ecosystem/): A structured reactive stack — every layer written in pure Python for 3.14t free-threading - [FAQ](/kida/docs/about/faq/): Frequently asked questions about Kida - [Performance](/kida/docs/about/performance/): Benchmarks and optimization tips - [Thread Safety](/kida/docs/about/thread-safety/): Free-threading and concurrent rendering ## Advanced - [Advanced](/kida/docs/advanced/): Advanced features for framework authors and power users - [Accessibility Linting](/kida/docs/advanced/a11y-linting/): Static accessibility checks for templates — img-alt, heading-order, html-lang, input-label - [Static Analysis](/kida/docs/advanced/analysis/): Analyze templates for dependencies, purity, and caching potential - [Block Caching](/kida/docs/advanced/block-caching/): Connect static analysis to runtime block caching for framework-level optimization - [Compiler Internals](/kida/docs/advanced/compiler/): F-string coalescing, AST preservation, and compilation optimization - [Content Stacks](/kida/docs/advanced/content-stacks/): Collect and render content from nested templates with push and stack tags - [Template Coverage](/kida/docs/advanced/coverage/): Track which template lines execute during rendering with LCOV and Cobertura export - [Content Security Policy](/kida/docs/advanced/csp/): CSP nonce injection for inline scripts and styles in templates - [Template Formatter](/kida/docs/advanced/formatter/): Opinionated template formatting with kida fmt - [Profiling](/kida/docs/advanced/profiling/): Opt-in render instrumentation with zero overhead when disabled - [Sandboxed Environment](/kida/docs/advanced/sandbox/): Run untrusted templates safely with configurable security policies - [Scoped Slots](/kida/docs/advanced/scoped-slots/): Pass data from components back to their callers with let bindings - [Security Hardening](/kida/docs/advanced/security/): Context-specific escaping, URL validation, and attribute safety - [T-Strings (PEP 750)](/kida/docs/advanced/t-strings/): Auto-escaping HTML and composable regex via Python 3.14 template strings - [Template Type Checking](/kida/docs/advanced/type-checking/): Annotate expected context types with template declarations for compile-time validation - [Worker Auto-Tuning](/kida/docs/advanced/workers/): Workload-aware parallelization for free-threaded Python ## Extending - [Extending](/kida/docs/extending/): Extend Kida with custom filters, tests, globals, and loaders - [Custom Filters](/kida/docs/extending/custom-filters/): Create custom template filters - [Custom Globals](/kida/docs/extending/custom-globals/): Add global functions and variables - [Custom Loaders](/kida/docs/extending/custom-loaders/): Build custom template loaders - [Custom Tests](/kida/docs/extending/custom-tests/): Create custom test functions for conditionals - [Extensions](/kida/docs/extending/extensions/): Build custom template tags with the Extension plugin architecture ## Get Started - [Get Started](/kida/docs/get-started/): Install Kida and render your first HTML template with a Python template engine built for modern apps - [Coming from Jinja2](/kida/docs/get-started/coming-from-jinja2/): Quick cheat sheet for Jinja2 users switching to Kida - [First Project](/kida/docs/get-started/first-project/): Build a multi-page template project with inheritance, filters, and context - [Installation](/kida/docs/get-started/installation/): Install Kida using pip, uv, or from source - [Quickstart](/kida/docs/get-started/quickstart/): Render your first Kida template in 2 minutes - [T-String Templates](/kida/docs/get-started/tstring-templates/): Use Python 3.14 t-strings for inline template rendering with auto-escaping ## Reference - [Reference](/kida/docs/reference/): API, filters, tests, and configuration reference - [API Reference](/kida/docs/reference/api/): Core classes and methods - [CLI Reference](/kida/docs/reference/cli/): Command-line tools for checking, rendering, formatting, inspecting, and generating with Kida templates - [Configuration](/kida/docs/reference/configuration/): All Environment configuration options - [Filters Reference](/kida/docs/reference/filters/): All built-in filters with examples, including terminal color, style, layout, and data display filters - [Tests Reference](/kida/docs/reference/tests/): All built-in tests with examples ## Syntax - [Syntax](/kida/docs/syntax/): Kida template language syntax for HTML templates, inheritance, filters, and control flow - [Async](/kida/docs/syntax/async/): Async iteration and await in templates - [Caching](/kida/docs/syntax/caching/): Block-level output caching in templates - [Control Flow](/kida/docs/syntax/control-flow/): Conditionals, loops, and pattern matching in Kida templates - [Filters](/kida/docs/syntax/filters/): Transform values in template expressions - [Functions](/kida/docs/syntax/functions/): Define reusable template functions and macros - [Includes](/kida/docs/syntax/includes/): Include partial templates and components - [Inheritance](/kida/docs/syntax/inheritance/): Template inheritance with extends and blocks - [Variables](/kida/docs/syntax/variables/): Output expressions and variable access in Kida templates ## Troubleshooting - [Troubleshooting](/kida/docs/troubleshooting/): Common errors and how to fix them - [Circular Imports](/kida/docs/troubleshooting/circular-imports/): K-TPL-003 — Circular macro import detection - [render_block and Def Scope](/kida/docs/troubleshooting/render-block-scope/): Blocks do not inherit defs from the same template - [Template Not Found](/kida/docs/troubleshooting/template-not-found/): Fix template loading errors - [Undefined Variable](/kida/docs/troubleshooting/undefined-variable/): Debug undefined variable errors ## Tutorials - [Tutorials](/kida/docs/tutorials/): Step-by-step guides for Jinja2 migration, framework integration, and common Kida workflows - [Agent Integration](/kida/docs/tutorials/agent-integration/): End-to-end guide — configure an AI agent to produce AMP output, wire it through GitHub Actions, and render formatted PR comments - [Jinja2 vs Kida: Components](/kida/docs/tutorials/component-comparison/): A real-world dashboard card built in Jinja2 and Kida — side by side - [Build Custom Filters](/kida/docs/tutorials/custom-filters/): Create custom template filters from scratch - [Django Integration](/kida/docs/tutorials/django-integration/): Use Kida as a Django template backend with kida.contrib.django - [Flask Integration](/kida/docs/tutorials/flask-integration/): Use Kida templates with Flask web framework - [Migrate from Jinja2](/kida/docs/tutorials/migrate-from-jinja2/): Rewrite Jinja2 templates for Kida - [Refactor-Safe Templates](/kida/docs/tutorials/refactor-safe-templates/): Move folders without breaking a single include — relative paths and namespace aliases - [Starlette & FastAPI Integration](/kida/docs/tutorials/starlette-integration/): Use Kida with Starlette and FastAPI via kida.contrib.starlette - [Terminal Rendering](/kida/docs/tutorials/terminal-rendering/): Build rich terminal output with colors, components, and live updates - [Upgrade to 0.7](/kida/docs/tutorials/upgrade-to-v0.7/): Migrate to strict-by-default variable access and the new null-safe idioms - [Upgrade to 0.8](/kida/docs/tutorials/upgrade-to-v0.8/): Optional chaining now treats missing Mapping keys like dict.get() ## Usage - [Usage](/kida/docs/usage/): Loading templates, rendering HTML, streaming output, integrating Kida into Python applications, and rendering AI agent output - [Agent Templates](/kida/docs/usage/agent-templates/): Built-in Kida templates for rendering AI agent output — code review, PR summary, deploy preview, dependency review, security scan, and release notes - [Agent Message Protocol (AMP)](/kida/docs/usage/amp/): Decouple AI agent output from presentation with AMP — a protocol for structured, multi-surface rendering - [Components](/kida/docs/usage/components/): Build reusable UI components with defs, slots, typed props, and context propagation - [Error Boundaries](/kida/docs/usage/error-boundaries/): Catch rendering errors in templates with try/fallback blocks - [Error Handling](/kida/docs/usage/error-handling/): Template errors, debugging, and stack traces - [Escaping](/kida/docs/usage/escaping/): HTML and Markdown escaping plus safe content handling - [Framework Integration](/kida/docs/usage/framework-integration/): Block rendering, introspection, and composition APIs for Chirp, Bengal, and custom adapters - [GitHub Action](/kida/docs/usage/github-action/): Render CI reports from structured tool output as GitHub step summaries and PR comments - [Internationalization (i18n)](/kida/docs/usage/i18n/): Translate templates with trans blocks, pluralization, and gettext integration - [Loading Templates](/kida/docs/usage/loading-templates/): Template loaders and search paths - [Provide / Consume](/kida/docs/usage/provide-consume/): Pass state from parent components to descendants without prop drilling - [Rendering Contexts](/kida/docs/usage/rendering-contexts/): Passing variables and context to templates - [Streaming](/kida/docs/usage/streaming/): Stream template output as chunks for HTTP responses and large pages - [Terminal Rendering](/kida/docs/usage/terminal-rendering/): Declarative terminal/CLI output with ANSI colors, components, and live rendering ## Optional - [index.json](/kida/index.json): Search index with page metadata and excerpts - [robots.txt](/kida/robots.txt): Content Signals directives for AI crawlers