JobSelect 0.11.3__tar.gz → 0.11.4__tar.gz
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.
- {jobselect-0.11.3 → jobselect-0.11.4}/JobSelect.egg-info/PKG-INFO +1 -1
- {jobselect-0.11.3 → jobselect-0.11.4}/PKG-INFO +1 -1
- jobselect-0.11.4/cli/api_val.py +53 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/cli/model_select.py +1 -1
- {jobselect-0.11.3 → jobselect-0.11.4}/pyproject.toml +1 -1
- jobselect-0.11.3/cli/api_val.py +0 -33
- {jobselect-0.11.3 → jobselect-0.11.4}/JobSelect.egg-info/SOURCES.txt +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/JobSelect.egg-info/dependency_links.txt +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/JobSelect.egg-info/entry_points.txt +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/JobSelect.egg-info/requires.txt +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/JobSelect.egg-info/top_level.txt +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/LICENSE +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/README.md +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/cli/jobselect.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/cli/utils.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/Model.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/__init__.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/eval.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/pred.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/prep/__init__.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/prep/data_prep.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/prep/label_vocab.json +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/prep/prepared_data.npz +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/prep/sym_map.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/prep/test.py +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model/prep/vectorizer.pkl +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model_out/skill_classifier.pt +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/model_out/training_history.json +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/setup.cfg +0 -0
- {jobselect-0.11.3 → jobselect-0.11.4}/test/test_model.py +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""
|
|
2
|
+
api_val.py
|
|
3
|
+
----------
|
|
4
|
+
Handles the API key prompt. Stores the user-entered key in module-level
|
|
5
|
+
`key` so model_select can read it lazily at inference time.
|
|
6
|
+
|
|
7
|
+
No imports from model_select or api_logic — circular import is gone.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
from .utils import clear_console, API_title, query
|
|
12
|
+
from dotenv import load_dotenv
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
import os
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
key: str = ""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _load_env() -> None:
|
|
21
|
+
candidates = [
|
|
22
|
+
Path.cwd() / ".env",
|
|
23
|
+
Path.home() / ".jobselect" / ".env",
|
|
24
|
+
Path(__file__).resolve().parent.parent / ".env",
|
|
25
|
+
]
|
|
26
|
+
for path in candidates:
|
|
27
|
+
if path.exists():
|
|
28
|
+
load_dotenv(dotenv_path=path, override=False)
|
|
29
|
+
return
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def val_api() -> str:
|
|
33
|
+
"""Prompt user for API key exactly once. Stores result in module-level `key`."""
|
|
34
|
+
clear_console()
|
|
35
|
+
API_title()
|
|
36
|
+
query("Enter API Key (Press Enter to run locally)")
|
|
37
|
+
|
|
38
|
+
global key
|
|
39
|
+
key = input(" >> ").strip()
|
|
40
|
+
return key
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def infer_mode() -> str:
|
|
44
|
+
"""
|
|
45
|
+
Return 'API' or 'LOCAL'.
|
|
46
|
+
Call after val_api() has run.
|
|
47
|
+
Checks typed key first, then .env fallback.
|
|
48
|
+
"""
|
|
49
|
+
if key:
|
|
50
|
+
return "API"
|
|
51
|
+
_load_env()
|
|
52
|
+
env_key = os.getenv("JOBSELECT_API_KEY", "").strip()
|
|
53
|
+
return "API" if env_key else "LOCAL"
|
|
@@ -18,7 +18,7 @@ if not _env_path.exists():
|
|
|
18
18
|
_env_path = PROJECT_ROOT / ".env"
|
|
19
19
|
load_dotenv(dotenv_path=_env_path)
|
|
20
20
|
|
|
21
|
-
API_URL = os.getenv("JOBSELECT_API_URL", "")
|
|
21
|
+
API_URL = os.getenv("JOBSELECT_API_URL", "").rstrip("/")
|
|
22
22
|
_ENV_KEY = os.getenv("JOBSELECT_API_KEY", "").strip()
|
|
23
23
|
|
|
24
24
|
def _resolve_key() -> str:
|
jobselect-0.11.3/cli/api_val.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
api_val.py
|
|
3
|
-
----------
|
|
4
|
-
Handles the API key prompt. Stores the user-entered key in module-level
|
|
5
|
-
`key` so model_select can read it lazily at inference time.
|
|
6
|
-
|
|
7
|
-
No imports from model_select or api_logic — circular import is gone.
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import os
|
|
12
|
-
|
|
13
|
-
from .utils import clear_console, API_title, query
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
key: str = ""
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def val_api() -> str:
|
|
20
|
-
clear_console()
|
|
21
|
-
API_title()
|
|
22
|
-
query("Enter API Key (Press Enter to run locally)")
|
|
23
|
-
|
|
24
|
-
global key
|
|
25
|
-
key = input(" >> ").strip()
|
|
26
|
-
return key
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def infer_mode() -> str:
|
|
30
|
-
if key:
|
|
31
|
-
return "API"
|
|
32
|
-
env_key = os.getenv("JOBSELECT_API_KEY", "").strip()
|
|
33
|
-
return "API" if env_key else "LOCAL"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|