Theme
Version
GitHub PyPI Discord

API reference

The citry public API, by area.

  • Component - The base class every component subclasses.
  • Component introspection - Frozen metadata records for component catalogs, schemas, assets, and extensions.
  • Component graph - Authored component dependencies, reverse references, source locations, and partial-analysis problems.
  • Component libraries - Engine-neutral component definitions, explicit manifests, and per-Citry installations.
  • Citry instance and config - The Citry instance that scopes components, settings, and caches.
  • Rendering - The render pipeline, its output structs, and Citry's trusted-HTML marker. citry.Markup is exactly markupsafe.Markup. Markup(value) trusts the complete value without sanitizing or validating anything.
  • Slots - The slot value and fill types.
  • Nodes - The runtime node classes the compiled template instantiates.
  • Template analysis - Discovery, analysis, source mapping, and formatting for Python-embedded templates.
  • Preview - Component examples, layouts, and metadata for command-owned preview pages.
  • Extensions - The plugin system: the extension base, its commands, and the hook context objects.
  • Dependencies - The JS/CSS dependency types collected and placed at serialize time, and the built-in citry.ext.dependencies extension that owns them.
  • Render cache keys - Exact key helpers and errors for component and named-fragment render caches.
  • Internationalization - Locale contexts, messages, named formats, and strict localized-input parsers.
  • Events - Event handlers declared on components: the class Events: contract, the typed base for it, and the built-in citry.ext.events extension that owns it.
  • Browser APIs - Component JavaScript, Citry's Alpine magics, and page-wide browser methods.
  • HTML attributes - Helpers for Vue-like class/style merging on HTML elements.
  • Web integration - The route table a web framework mounts, and the request/response types handlers use (see citry.contrib).
  • Contrib integrations - Adapters mounting citry into web frameworks, and cache adapters for shared stores (the citry.contrib.<name> modules).
  • Built-in tags - The built-in <c-*> tags every component can use.