Expand description
Path matching and routing utilities.
This module provides path parameter extraction with type converters,
similar to FastAPI’s path converters: {id:int}, {value:float},
{uuid:uuid}, {path:path}.
§Trailing Slash Handling
This module also handles trailing slash normalization via TrailingSlashMode:
Strict: Exact match required (default)Redirect: 308 redirect to canonical form (no trailing slash)RedirectWithSlash: 308 redirect to form with trailing slashMatchBoth: Accept both forms without redirect
Structs§
- Param
Info - Path parameter information.
- Route
Pattern - A parsed route pattern.
- Route
Table - Simple route table for path matching.
- UrlRegistry
- Registry for named routes, enabling URL generation.
Enums§
- Converter
- Path parameter type converter.
- Path
Segment - A parsed path segment.
- Route
Lookup - Result of a route lookup.
- Trailing
Slash Mode - Trailing slash handling mode.
- UrlError
- Error that can occur during URL generation.
Functions§
- format_
allow_ header - Format allowed methods as an HTTP Allow header value.
- method_
order - Get the sort order for an HTTP method.
- url_
decode - URL-decode a percent-encoded string.
- url_
encode - URL-encode a string for use in a query parameter.
- url_
encode_ path_ segment - URL-encode a path segment.