Skip to content

get_app_path

faststream.cli.utils.imports.get_app_path #

get_app_path(app)

Get the application path.

Source code in faststream/cli/utils/imports.py
def get_app_path(app: str) -> Tuple[Path, str]:
    """Get the application path."""
    if ":" not in app:
        raise SetupError(f"`{app}` is not a FastStream")

    module, app_name = app.split(":", 2)

    mod_path = Path.cwd()
    for i in module.split("."):
        mod_path = mod_path / i

    return mod_path, app_name