kamihi.cli.commands.run
⚓︎
Kamihi framework project execution.
License
MIT
Functions:
Name | Description |
---|---|
host_callback |
Ensure the host value is valid. |
import_actions |
Import all Python files from a specified directory. |
import_file |
Import a Python file from a specified path. |
import_models |
Import all Python files from a specified directory. |
run |
Run a project with the Kamihi framework. |
host_callback
⚓︎
host_callback(value: str | None) -> str | None
Ensure the host value is valid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str | None
|
The host value. |
required |
Returns:
Type | Description |
---|---|
str | None
|
str | None: The validated host value. |
Source code in src/kamihi/cli/commands/run.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
import_actions
⚓︎
import_actions(actions_dir: Path) -> None
Import all Python files from a specified directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The path to the directory containing Python files. |
required |
Source code in src/kamihi/cli/commands/run.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
import_file
⚓︎
import_file(path: Path, name: str) -> None
Import a Python file from a specified path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The path to the Python file. |
required |
|
str
|
The name of the module. |
required |
Source code in src/kamihi/cli/commands/run.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
import_models
⚓︎
import_models(models_dir: Path) -> None
Import all Python files from a specified directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The path to the directory containing Python files. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
None
|
True if models were imported successfully, False otherwise. |
Source code in src/kamihi/cli/commands/run.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
run
⚓︎
run(
ctx: Context,
log_level: Annotated[
LogLevel | None,
Option(
--log - level,
-l,
help="Set the logging level for console loggers.",
show_default=INFO,
),
] = None,
web_host: Annotated[
str | None,
Option(
...,
--host,
-h,
help="Host of the admin web panel",
callback=host_callback,
show_default=localhost,
),
] = None,
web_port: Annotated[
int | None,
Option(
...,
--port,
-p,
help="Port of the admin web panel",
min=1024,
max=65535,
show_default=4242,
),
] = None,
) -> None
Run a project with the Kamihi framework.
Source code in src/kamihi/cli/commands/run.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|