frogml-cli 0.0.1__py3-none-any.whl → 0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- frogml_cli/__init__.py +1 -1
- frogml_cli/commands/models/init/_logic/template/general/cookiecutter.json +1 -1
- frogml_cli/commands/models/init/ui.py +8 -4
- frogml_cli/tools/utils.py +20 -1
- {frogml_cli-0.0.1.dist-info → frogml_cli-0.0.2.dist-info}/METADATA +1 -1
- {frogml_cli-0.0.1.dist-info → frogml_cli-0.0.2.dist-info}/RECORD +8 -8
- {frogml_cli-0.0.1.dist-info → frogml_cli-0.0.2.dist-info}/WHEEL +0 -0
- {frogml_cli-0.0.1.dist-info → frogml_cli-0.0.2.dist-info}/entry_points.txt +0 -0
frogml_cli/__init__.py
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
from typing import List
|
2
|
+
|
1
3
|
import click
|
2
4
|
from frogml.core.tools.logger.logger import get_frogml_logger
|
3
5
|
|
@@ -5,10 +7,14 @@ from frogml_cli.commands.models.init._logic.initialize_model_structure import (
|
|
5
7
|
initialize_model_structure,
|
6
8
|
)
|
7
9
|
from frogml_cli.inner.tools.cli_tools import FrogMLCommand
|
10
|
+
from frogml_cli.tools.utils import get_models_init_example_choices
|
8
11
|
|
9
12
|
logger = get_frogml_logger()
|
10
13
|
|
11
14
|
|
15
|
+
MODELS_INIT_EXAMPLE_CHOICES: List[str] = get_models_init_example_choices()
|
16
|
+
|
17
|
+
|
12
18
|
@click.command("init", cls=FrogMLCommand)
|
13
19
|
@click.option(
|
14
20
|
"--model-directory", metavar="NAME", required=False, help="folder for model content"
|
@@ -23,10 +29,8 @@ logger = get_frogml_logger()
|
|
23
29
|
"--example",
|
24
30
|
metavar="NAME",
|
25
31
|
required=False,
|
26
|
-
type=click.Choice(
|
27
|
-
|
28
|
-
),
|
29
|
-
help="""Generate a fully functioning example of a Qwak based model. Options: titanic / credit_risk / churn""",
|
32
|
+
type=click.Choice(MODELS_INIT_EXAMPLE_CHOICES, case_sensitive=True),
|
33
|
+
help=f"Generate a fully functioning example of a Qwak based model. Options: {' / '.join(MODELS_INIT_EXAMPLE_CHOICES)}",
|
30
34
|
)
|
31
35
|
@click.argument("uri", metavar="URI", required=True)
|
32
36
|
def model_init(
|
frogml_cli/tools/utils.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
import logging
|
2
2
|
import sys
|
3
3
|
from contextlib import contextmanager
|
4
|
-
from
|
4
|
+
from pathlib import Path
|
5
|
+
from typing import Callable, List, Optional
|
5
6
|
|
6
7
|
from frogml.core.tools.logger.logger import (
|
7
8
|
get_frogml_logger,
|
@@ -43,3 +44,21 @@ def frogml_spinner(
|
|
43
44
|
if end_text:
|
44
45
|
sp.text = end_text
|
45
46
|
sp.ok("✅")
|
47
|
+
|
48
|
+
|
49
|
+
def get_models_init_example_choices() -> List[str]:
|
50
|
+
"""Dynamically get available template choices from the template directory."""
|
51
|
+
template_dir = (
|
52
|
+
Path(__file__).parent.parent
|
53
|
+
/ "commands"
|
54
|
+
/ "models"
|
55
|
+
/ "init"
|
56
|
+
/ "_logic"
|
57
|
+
/ "template"
|
58
|
+
)
|
59
|
+
|
60
|
+
return [
|
61
|
+
item.name
|
62
|
+
for item in template_dir.iterdir()
|
63
|
+
if item.is_dir() and not item.name.startswith(".")
|
64
|
+
]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
frogml_cli/__init__.py,sha256
|
1
|
+
frogml_cli/__init__.py,sha256=XEZR5icFmwjSToyn9bnCF_RlgfF9KCdCKtbF-afHdwM,157
|
2
2
|
frogml_cli/cli.py,sha256=Gh-KPvBf_X243Cz2TGx_mWd4K4NgXcSmpBxZfrFQSkc,1585
|
3
3
|
frogml_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
frogml_cli/commands/_logic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -205,7 +205,7 @@ frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model
|
|
205
205
|
frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/data.csv,sha256=Qr47gqLlBzvVyiO84dHDFCa3j3LSDNiS86rKorowoHU,53393
|
206
206
|
frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/model.py,sha256=L5wmOy9O1ACyZFzB32ZT44fDy5wtGGELL8UkMnvDTj0,4005
|
207
207
|
frogml_cli/commands/models/init/_logic/template/general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
208
|
-
frogml_cli/commands/models/init/_logic/template/general/cookiecutter.json,sha256=
|
208
|
+
frogml_cli/commands/models/init/_logic/template/general/cookiecutter.json,sha256=Ddx20uknTUv-I8AnZ35T9B7zsNHmE6VtoIE0vRerx3k,139
|
209
209
|
frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
210
210
|
frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/__init__.py,sha256=LG2LPM98oRS0v2uYDYs7hI7EIaui79YT--f91BbTqD4,120
|
211
211
|
frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/conda.yml,sha256=EDD9m5sTQS2Kg_e6IvxaAMrTN1J8xrdACVD-sVZm5LQ,140
|
@@ -230,7 +230,7 @@ frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.mo
|
|
230
230
|
frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
231
231
|
frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
232
232
|
frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/test_titanic.py,sha256=A75drbpCH-wNYwGZHS16xFBN7aApYbA7w_G1Hc2BwkU,761
|
233
|
-
frogml_cli/commands/models/init/ui.py,sha256=
|
233
|
+
frogml_cli/commands/models/init/ui.py,sha256=p2VIxouKmaUraYD_wkdgLPeZmNGVG6p-uxoywz4r9iA,2063
|
234
234
|
frogml_cli/commands/models/list/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
235
235
|
frogml_cli/commands/models/list/_logic.py,sha256=6ef3aBkN55b_4Z4VktNSzH6L0jXT2dFWz0LyYwWJ4MA,193
|
236
236
|
frogml_cli/commands/models/list/ui.py,sha256=L5FotbJbeweTklDTKIA24_sdLNH3t53JHQFOx-JtBa4,1498
|
@@ -280,8 +280,8 @@ frogml_cli/tools/colors.py,sha256=7pui_GGjC4uZKYFsIyXaJjYsjLxJVHb4OrfTgr93hqo,28
|
|
280
280
|
frogml_cli/tools/const.py,sha256=XDaMAVfScXoFc5fHbsNuqAefUD2MoZY-cAEMoh1xaYk,152
|
281
281
|
frogml_cli/tools/files.py,sha256=AyKJTOy7NhvP3SrqwIw_lxYNCOy1CvLgMmSJpWZ0OKM,2257
|
282
282
|
frogml_cli/tools/log_handling.py,sha256=QlgxbCmLLPK4wRyViWgAW8WLZ39Do1hYAvRyFWGbnFs,6362
|
283
|
-
frogml_cli/tools/utils.py,sha256=
|
284
|
-
frogml_cli-0.0.
|
285
|
-
frogml_cli-0.0.
|
286
|
-
frogml_cli-0.0.
|
287
|
-
frogml_cli-0.0.
|
283
|
+
frogml_cli/tools/utils.py,sha256=Vliw-w6i-93dgZ3M09EgWjttHMuhT-3CH7tbWVKsf8s,1668
|
284
|
+
frogml_cli-0.0.2.dist-info/METADATA,sha256=ZaO3QJi-64jkFgP3WdsFPOUPtur5tTePKxl9eLhWxtc,2202
|
285
|
+
frogml_cli-0.0.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
286
|
+
frogml_cli-0.0.2.dist-info/entry_points.txt,sha256=2H5x0V_E73HeywIMBRRvZMgeRtmX5820KmSLiNFzDcA,53
|
287
|
+
frogml_cli-0.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|