Skip to main content

)彡 Kida

PyPI version Build Status Python 3.14+ Python 3.14t no-GIL tested License: MIT

Kida, a cross-eyed snow-lynx Bengal cat, actively assembling jungle components that become web, terminal, Markdown, and CI output

Server-side components for Python—typed, composable, and checked before render.

Kida gives Python applications a real component model: typed props, named and scoped slots, static call-site validation, and error boundaries. The same pure- Python engine renders HTML, Markdown, terminal output, and CI reports—with no npm, no build step, and no runtime dependencies.

Read the docs · Build a component · Compare with Jinja2 macros

Why Kida

Templates become application architecture long before most template engines notice. Arguments stay implicit, composition collapses into one caller block, and broken component calls surface only when a request renders the wrong path.

Kida makes those contracts explicit:

  • Typed props document and validate a component's inputs.
  • Named and scoped slots compose structure without prop drilling.
  • Static validation catches bad names, missing props, and literal type mismatches before render.
  • Structured metadata lets frameworks discover components without parsing private AST internals.
  • One rendering model serves web pages, fragments, docs, terminals, and CI.

Quick Start

Kida requires Python 3.14 or later.

pip install kida-templates

Define a component and call it in the same template:

{% def card(title: str, variant: str = "default") %}
<article class="card card--{{ variant }}">
  <header>
    <h2>{{ title }}</h2>
    {% slot actions %}
  </header>
  <div class="card__body">{% slot %}</div>
</article>
{% enddef %}

{% call card("Settings", variant="elevated") %}
  {% slot actions %}<button>Save</button>{% end %}
  <p>Configure your preferences.</p>
{% endcall %}

Render it from ordinary Python:

from kida import Environment, FileSystemLoader

env = Environment(loader=FileSystemLoader("templates/"))
html = env.get_template("page.html").render()

Kida's canonical block ending is {% end %}. Matching explicit closers such as {% endif %}, {% endfor %}, and {% endblock %} are also accepted, so an otherwise compatible Jinja template does not need closer-only edits.

Catch Broken Calls Before Render

Suppose a call misspells label and passes a string where count expects an integer:

{% def badge(count: int, label: str) %}
<span class="badge">{{ count }} {{ label }}</span>
{% enddef %}

{{ badge(count="five", lable="Messages") }}

Run the checker:

kida check templates/ --strict --validate-calls
templates/dashboard.html:5: K-CMP-001: Call to 'badge' — unknown params: lable; missing required: label
templates/dashboard.html:5: K-CMP-002: type: badge() param 'count' expects int, got str ('five')

The mistake stays in the editor or CI—not in a user's request.

A Component Model, Not a Macro Convention

Capability Kida
Typed props {% def card(title: str, count: int = 0) %}
Named slots {% slot actions %} and {% slot %}
Scoped slots {% slot row let:item=item %}
Conditional content has_slot("footer")
Context propagation {% provide theme = "dark" %} and consume("theme")
Error boundaries {% try %}...{% fallback error %}...{% endtry %}
Co-located assets {% push "styles" %} and {% stack "styles" %}
Partial rendering render_block() and parameterized regions
Streaming render_stream() and render_stream_async()
Discovery kida components templates/ or the introspection API

Use Kida in Flask, Django, FastAPI, Starlette, Chirp, Bengal, scripts, and CI. Render full pages or HTMX fragments; reuse the same semantics for Markdown reports and ANSI-aware terminal interfaces.

The app-owned component authoring contract defines extraction heuristics, composition seams, and framework/application ownership boundaries.

One System, Many Surfaces

Surface What Kida provides
Web applications Components, layouts, streaming, and block rendering
Static sites Reusable content components and scoped state
Terminal tools ANSI-aware tables, badges, panels, and dashboards
CI reports GitHub step summaries and PR comments from test and analysis data
Frameworks Component metadata, dependency analysis, and multi-root inspection

The GitHub Action includes templates for pytest, coverage, ruff, ty, Jest, Go test, SARIF, release notes, and agent reports. See the CI reporting guide.

Pure Python, Including Free-Threading

Kida has zero runtime dependencies. Templates compile to immutable Python code, render state lives in ContextVar, and environment mutation uses copy-on-write patterns. The documented sharing contract is tested under PYTHON_GIL=0 on free-threaded Python 3.14t.

That claim is intentionally bounded: it covers Kida's public thread-safety contract, not unsynchronized application state or custom callables.

Explore

kida render template.txt --data context.json
kida check templates/ --validate-calls --a11y --typed
kida components templates/ --json
kida fmt templates/
kida extract templates/ -o messages.pot

Status

Kida is pre-1.0 and used standalone, through mainstream Python frameworks, and across a broader pure-Python rendering stack. The API can still move, but the core commitments are stable: typed composition, static validation, render- surface parity, zero runtime dependencies, and free-threaded safety.

For migrations, start with the 0.13.0 release notes and follow the linked upgrade guides.

Python Components Ecosystem

Kida is the component layer in a personal, pure-Python stack built for Python 3.14t. Each project stands on its own; together they cover the path from content and components to applications, servers, sites, terminals, and developer tools.

Project Role
⌁⌁ Chirp Web framework
=^..^= Pounce ASGI server
)彡 Kida Server-side component system ← You are here
∿∿ Purr Content runtime
ᓚᘏᗢ Bengal Static-site integration
ฅᨐฅ Patitas Markdown parser
⌾⌾⌾ Rosettes Syntax highlighter
ᓃ‿ᓃ Milo Terminal UI framework

License

MIT License — see LICENSE.

Metadata

Release files for kida-templates 0.13.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 kida-templates 0.13.0
File Size Uploaded Provenance Actions
kida_templates-0.13.0.tar.gz 742.9 kB With provenance Details for kida_templates-0.13.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kida-templates 0.13.0
File Interpreter ABI Platform Actions
kida_templates-0.13.0-py3-none-any.whl Python 3 none any Details for kida_templates-0.13.0-py3-none-any.whl

Total release size: 1.2 MB

Release files / kida_templates-0.13.0.tar.gz

Download URL kida_templates-0.13.0.tar.gz
Size 742.9 kB
Tags Source
SHA-256 checksum
How to use checksums
389fcf89bfdd2f57f1778a8831407e57f8d1a9d5edbaa7584ababa56ab2bdcc1
BLAKE2b-256 checksum
How to use checksums
cac9a8d0c7ef7e5ae671c273f31b5bba1efc2af903ef2dba6205087f34a94d74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.

Transparency log

Release files / kida_templates-0.13.0-py3-none-any.whl

Download URL kida_templates-0.13.0-py3-none-any.whl
Size 486.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f68739b59775f67b6e2a62735227ff864b7e332a411cc00165a29db66344c1c4
BLAKE2b-256 checksum
How to use checksums
958cd6abfa2c8d6248d7b8142bd7a9e213e4261ab59c31f4c783e928c4103e0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.

Transparency log

Security for kida-templates 0.13.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kida_templates-0.13.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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