quart.utils module#

quart.utils.decode_headers(headers: Iterable[Tuple[bytes, bytes]]) Headers#
quart.utils.encode_headers(headers: Headers) List[Tuple[bytes, bytes]]#
quart.utils.file_path_to_path(*paths: Union[bytes, str, PathLike]) Path#
quart.utils.is_coroutine_function(func: Any) bool#
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]#