Adds s-expression HTML tags (FTags) to FastAPI views. Inspired by FastHTML's use of fastcore's FT components.
Project description
FastAPI Tags
Adds s-expression HTML tags (FTags) to FastAPI views. Inspired by FastHTML's use of fastcore's FT components.
Install the package:
uv add fastapi-tags
Usage:
from fastapi import FastAPI
import fastapi_tags as ft
app = FastAPI()
@app.get("/", response_class=ft.FTResponse)
async def index():
return ft.Html(ft.H1("Hello, world!", style="color: blue;"))
If you want to do snippets, just skip the ft.Html tag:
@app.get("/time", response_class=ft.FTResponse)
async def time():
return ft.P("Time to do code!")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastapi_tags-0.2.0.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters