quart.utils module

quart.utils.ensure_coroutine(func: Callable) → Callable
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[Any, None, None]]

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]