mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-03-02 01:10:47 +01:00
doc: add missing docstring + add missing feature to README (#57)
This commit is contained in:
@@ -18,10 +18,16 @@ def _ensure_project_in_path():
|
||||
|
||||
|
||||
def import_from_string(import_path: str):
|
||||
"""Import an object from a string path like 'module.submodule:attribute'.
|
||||
"""Import an object from a dotted string path.
|
||||
|
||||
Args:
|
||||
import_path: Import path in ``"module.submodule:attribute"`` format
|
||||
|
||||
Returns:
|
||||
The imported attribute
|
||||
|
||||
Raises:
|
||||
typer.BadParameter: If the import path is invalid or import fails.
|
||||
typer.BadParameter: If the import path is invalid or import fails
|
||||
"""
|
||||
if ":" not in import_path:
|
||||
raise typer.BadParameter(
|
||||
|
||||
Reference in New Issue
Block a user