Integrates the Chameleon template language with FastAPI for server-side HTML rendering in Python web applications.
fastapi-chameleon is a Python library that adds Chameleon template language integration to FastAPI web applications. It solves the problem of server-side HTML rendering in FastAPI by providing a simple decorator-based approach to connect view functions with Chameleon templates, enabling developers to build dynamic web pages with minimal boilerplate.
Python developers building web applications with FastAPI who need server-side HTML rendering capabilities and prefer using Chameleon as their template language.
Developers choose fastapi-chameleon because it provides a clean, minimal integration between FastAPI and Chameleon templates with support for both sync and async views, custom error pages, and development-friendly features like template auto-reload.
Adds integration of the Chameleon template language to FastAPI. #pypackage
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses a clean @fastapi_chameleon.template decorator to link view functions to Chameleon templates, reducing boilerplate code as shown in the usage examples.
Works seamlessly with both synchronous and asynchronous FastAPI view methods, providing flexibility in request handling without extra configuration.
Supports automatic template reloading during development via the auto_reload parameter in global_init(), enabling faster iteration cycles.
Provides functions like not_found() and generic_error() for user-friendly HTML error responses, addressing FastAPI's default JSON 404s with custom templates.
Restricted to the Chameleon template engine, which has a smaller ecosystem and community compared to alternatives like Jinja2, as hinted by the sister project for Jinja.
Requires explicit setup with fastapi_chameleon.global_init() to specify template folders and settings, adding an extra step that some frameworks automate.
Custom error handling relies on manual function calls in view methods, which can clutter code and may not integrate smoothly with FastAPI's native exception middleware.