class

Analyzer::Python::FastHTML

Inherits Analyzer::Python::PythonEngine < Analyzer < FileHelper < Reference < Object

Constants

API_ROUTER_RE = /^\s*(\w+)\s*=\s*(?:\w+\.)?APIRouter\s*\(\s*(?:prefix\s*=\s*)?(?:(['"])(.*?)\2)?/m

ar = APIRouter(prefix="/products"): @ar(...) / @ar.get(...) routes sit under the prefix, which FastHTML prepends as-is.

INJECTED = ["self", "req", "request", "session", "sess", "auth", "htmx", "app", "scope"] of ::String
INJECTED_TYPE_RE = /\b(?:Request|HtmxHeaders|Starlette|FastHTML)\b/

Annotations FastHTML fills from the request itself.

PATH_PARAM_RE = /\{([A-Za-z_]\w*)(?::[^}]*)?\}/
RT_NAME_RE = /^\s*\w+\s*,\s*(\w+)\s*=\s*fast_app\s*\(/m

app, rt = fast_app() may name the route decorator something else.

VERBS = ["get", "post", "put", "delete", "patch", "head", "options", "trace"] of ::String
WS_ATTRIBUTES = {"ws" => "GET"}

@app.ws("/ws"): a WebSocket route, emitted as GET + protocol "ws". Its handler arguments are message fields, not query/form params.

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source