google styled doc

This commit is contained in:
2026-03-08 00:29:23 +05:30
parent 37b892f695
commit f03e250763
7 changed files with 261 additions and 447 deletions

View File

@@ -1,9 +1,10 @@
"""
openapi_first.cli
========================
Command-line interface for FastAPI OpenAPI-first scaffolding utilities.
---
## Summary
This CLI bootstraps OpenAPI-first FastAPI applications from versioned,
bundled templates packaged with the library.
"""
@@ -20,6 +21,10 @@ DEFAULT_TEMPLATE = "health_app"
def available_templates() -> list[str]:
"""
Return a list of available application templates.
Returns:
list[str]:
Sorted list of template names found in the internal templates directory.
"""
root = resources.files("openapi_first.templates")
return sorted(
@@ -32,6 +37,16 @@ def available_templates() -> list[str]:
def copy_template(template: str, target_dir: Path) -> None:
"""
Copy a bundled OpenAPI-first application template into a directory.
Args:
template (str):
Name of the template to copy.
target_dir (Path):
Filesystem path where the template should be copied.
Raises:
FileNotFoundError:
If the requested template does not exist.
"""
target_dir = target_dir.resolve()
target_dir.mkdir(parents=True, exist_ok=True)