Skip to main content

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.

Test Package version Supported Python versions

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_tags-0.2.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_tags-0.2.0.tar.gz.

File metadata

  • Download URL: fastapi_tags-0.2.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for fastapi_tags-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c9dcff19dfff1aa4f2dc3c31d1040db5e44d0176f6ee09525e734412d4e815be
MD5 45641e15e4f48c6a39148c80986eeaba
BLAKE2b-256 b16f6d4b058c53314e14fca663bb520cf24fae4d2eb906c8e890679b102d4eda

See more details on using hashes here.

File details

Details for the file fastapi_tags-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_tags-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2412489858d64e67072a91793567a4fd354b006274ff7fe91287a90edb0e62ef
MD5 0b5351815a001f5ba136b17c1ed25eac
BLAKE2b-256 ec5d86cbd3c0083ecb5b7b3002cd7de39a9cf487fbcc0c98fb005d2ec06e3e49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page