quart.utils module

quart.utils.decode_headers(headers: Iterable[Tuple[bytes, bytes]]) werkzeug.datastructures.Headers
quart.utils.encode_headers(headers: werkzeug.datastructures.Headers) List[Tuple[bytes, bytes]]
quart.utils.file_path_to_path(*paths: Union[bytes, str, os.PathLike]) pathlib.Path
quart.utils.is_coroutine_function(func: Any) bool
quart.utils.redirect(location: str, code: int = 302) Response
quart.utils.run_sync(func: Callable[[...], Any]) Callable[[...], Coroutine[None, None, Any]]

Ensure that the sync function is run within the event loop.

If the func is not a coroutine it will be wrapped such that it runs in the default executor (use loop.set_default_executor to change). This ensures that synchronous functions do not block the event loop.

quart.utils.run_sync_iterable(iterable: Generator[Any, None, None]) AsyncGenerator[Any, None]