aplos-nca-saas-sdk 0.0.22__tar.gz → 0.0.23__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.
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/PKG-INFO +1 -1
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/devops/pypi/build.py +7 -7
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/pyproject.toml +1 -1
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/utilities/commandline_args.py +4 -25
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/utilities/environment_services.py +5 -26
- aplos_nca_saas_sdk-0.0.23/src/aplos_nca_saas_sdk/utilities/file_utility.py +65 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/version.py +1 -1
- aplos_nca_saas_sdk-0.0.22/src/aplos_nca_saas_sdk/utilities/file_utility.py +0 -33
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/.gitignore +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/.pypirc +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/.vscode/launch.json +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/.vscode/settings.json +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/LICENSE +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/README.md +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/devops/pypi/readme.md +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/devops/requirements.txt +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/docs/images/API_Configuration_blur.png +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/docs/images/aplos-nca-commandline-cropped.png +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/docs/images/aplos-nca-commandline.png +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/mypy.ini +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/mypy_checks.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/readme.md +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/requirements.dev.txt +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/requirements.txt +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/run-checks.sh +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/__init__.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/_config_base.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/app_settings_config.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/config_sample.json +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/file_upload_config.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/login_config.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/nca_execution_config.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/nca_validation_config.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/example_main.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/executions/config1.json +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.csv +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.dat +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.sas7bdat +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xls +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xlsx +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xpt +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_base.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_configurations.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_factory.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_response.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_suite.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/readme.md +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/file_upload_test.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/nca_analysis_test.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/nca_analysis_validation_test.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/_api_base.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/aws_cognito.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/aws_s3_presigned_payload.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/aws_s3_presigned_upload.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_analysis.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_app_configuration.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_authenticator.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_endpoints.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_file_download.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_file_upload.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_validations.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/run_analysis_execution.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/config.json +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/input.csv +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/meta_data.json +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/utilities/environment_vars.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/utilities/http_utility.py +0 -0
- {aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/tests/__init__.py +0 -0
@@ -111,19 +111,19 @@ def run_commands(
|
|
111
111
|
result = subprocess.run(
|
112
112
|
commands,
|
113
113
|
check=True,
|
114
|
-
|
114
|
+
capture_output=capture_output,
|
115
115
|
env=env, # pass any environment vars
|
116
116
|
# capture errors
|
117
|
-
stderr=subprocess.PIPE,
|
117
|
+
stderr=subprocess.PIPE if not capture_output else None,
|
118
118
|
# capture output
|
119
|
-
stdout=subprocess.PIPE,
|
119
|
+
stdout=subprocess.PIPE if not capture_output else None,
|
120
120
|
text=True,
|
121
121
|
)
|
122
122
|
|
123
|
-
if capture_output:
|
124
|
-
|
125
|
-
|
126
|
-
|
123
|
+
# if capture_output:
|
124
|
+
output = str(result.stdout)
|
125
|
+
print(output)
|
126
|
+
return output
|
127
127
|
|
128
128
|
except subprocess.CalledProcessError as e:
|
129
129
|
logger.exception(f"An error occurred: {e}")
|
@@ -13,7 +13,7 @@ from typing import List
|
|
13
13
|
from dotenv import load_dotenv
|
14
14
|
|
15
15
|
from aplos_nca_saas_sdk.utilities.environment_vars import EnvironmentVars
|
16
|
-
|
16
|
+
from aplos_nca_saas_sdk.utilities.file_utility import FileUtility
|
17
17
|
# load the environment (.env) file if any
|
18
18
|
# this may or may not be the desired results
|
19
19
|
load_dotenv(override=True)
|
@@ -254,29 +254,7 @@ class CommandlineArgs:
|
|
254
254
|
|
255
255
|
return user_input
|
256
256
|
|
257
|
-
|
258
|
-
self, starting_path: str, file_name: str, raise_error_if_not_found: bool = True
|
259
|
-
) -> str | None:
|
260
|
-
"""Searches the project directory structor for a file"""
|
261
|
-
|
262
|
-
starting_path = starting_path or __file__
|
263
|
-
parents = len(starting_path.split(os.sep)) -1
|
264
|
-
paths: List[str] = []
|
265
|
-
for parent in range(parents):
|
266
|
-
path = Path(starting_path).parents[parent].absolute()
|
267
|
-
|
268
|
-
tmp = os.path.join(path, file_name)
|
269
|
-
paths.append(tmp)
|
270
|
-
if os.path.exists(tmp):
|
271
|
-
return tmp
|
272
|
-
|
273
|
-
if raise_error_if_not_found:
|
274
|
-
searched_paths = "\n".join(paths)
|
275
|
-
raise RuntimeError(
|
276
|
-
f"Failed to locate environment file: {file_name} in: \n {searched_paths}"
|
277
|
-
)
|
278
|
-
|
279
|
-
return None
|
257
|
+
|
280
258
|
|
281
259
|
def check_for_environment_config(self):
|
282
260
|
"""Attempts to load an environment file"""
|
@@ -287,7 +265,8 @@ class CommandlineArgs:
|
|
287
265
|
|
288
266
|
if not env_file_path.exists():
|
289
267
|
# Try to find the file
|
290
|
-
|
268
|
+
fu: FileUtility = FileUtility()
|
269
|
+
file = fu.find_file(__file__, env_file_path.name)
|
291
270
|
file_path = Path(str(file))
|
292
271
|
|
293
272
|
if not file_path.exists():
|
@@ -9,7 +9,7 @@ import json
|
|
9
9
|
from typing import Dict, List, Any
|
10
10
|
from pathlib import Path
|
11
11
|
from dotenv import load_dotenv
|
12
|
-
|
12
|
+
from aplos_nca_saas_sdk.utilities.file_utility import FileUtility
|
13
13
|
|
14
14
|
class EnvironmentServices:
|
15
15
|
"""Environment Services"""
|
@@ -26,8 +26,9 @@ class EnvironmentServices:
|
|
26
26
|
|
27
27
|
if not starting_path:
|
28
28
|
starting_path = __file__
|
29
|
-
|
30
|
-
|
29
|
+
fu: FileUtility = FileUtility()
|
30
|
+
|
31
|
+
environment_file: str | None = fu.find_file(
|
31
32
|
starting_path=starting_path,
|
32
33
|
file_name=file_name,
|
33
34
|
raise_error_if_not_found=raise_error_if_not_found,
|
@@ -57,29 +58,7 @@ class EnvironmentServices:
|
|
57
58
|
|
58
59
|
return event
|
59
60
|
|
60
|
-
|
61
|
-
self, starting_path: str, file_name: str, raise_error_if_not_found: bool = True
|
62
|
-
) -> str | None:
|
63
|
-
"""Searches the project directory structure for a file"""
|
64
|
-
|
65
|
-
starting_path = starting_path or __file__
|
66
|
-
parents = len(starting_path.split(os.sep)) -1
|
67
|
-
paths: List[str] = []
|
68
|
-
for parent in range(parents):
|
69
|
-
path = Path(starting_path).parents[parent].absolute()
|
70
|
-
|
71
|
-
tmp = os.path.join(path, file_name)
|
72
|
-
paths.append(tmp)
|
73
|
-
if os.path.exists(tmp):
|
74
|
-
return tmp
|
75
|
-
|
76
|
-
if raise_error_if_not_found:
|
77
|
-
searched_paths = "\n".join(paths)
|
78
|
-
raise RuntimeError(
|
79
|
-
f"Failed to locate environment file: {file_name} in: \n {searched_paths}"
|
80
|
-
)
|
81
|
-
|
82
|
-
return None
|
61
|
+
|
83
62
|
|
84
63
|
def find_module_path(
|
85
64
|
self,
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"""
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
|
+
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
|
+
Property of Aplos Analytics, Utah, USA
|
5
|
+
"""
|
6
|
+
|
7
|
+
import os
|
8
|
+
from pathlib import Path
|
9
|
+
from typing import List
|
10
|
+
|
11
|
+
from aplos_nca_saas_sdk.utilities.environment_services import EnvironmentServices
|
12
|
+
|
13
|
+
|
14
|
+
class FileUtility:
|
15
|
+
"""General File Utilities"""
|
16
|
+
|
17
|
+
@staticmethod
|
18
|
+
def load_filepath(file_path: str) -> str:
|
19
|
+
"""Load the file_path"""
|
20
|
+
if not file_path:
|
21
|
+
raise RuntimeError("file_path is required")
|
22
|
+
elif file_path.startswith("${module}"):
|
23
|
+
# find the path
|
24
|
+
es: EnvironmentServices = EnvironmentServices()
|
25
|
+
root = es.find_module_path()
|
26
|
+
if not root:
|
27
|
+
raise RuntimeError(
|
28
|
+
"Unable to find the module path. Please use the ${module} syntax to define the file path"
|
29
|
+
)
|
30
|
+
file_path = file_path.replace("${module}", root)
|
31
|
+
|
32
|
+
# get the correct os path separator
|
33
|
+
file_path = os.path.normpath(file_path)
|
34
|
+
return file_path
|
35
|
+
|
36
|
+
|
37
|
+
def find_file(
|
38
|
+
self, starting_path: str, file_name: str, raise_error_if_not_found: bool = True
|
39
|
+
) -> str | None:
|
40
|
+
"""Searches the project directory structure for a file"""
|
41
|
+
|
42
|
+
starting_path = starting_path or __file__
|
43
|
+
parents = len(starting_path.split(os.sep)) -1
|
44
|
+
paths: List[str] = []
|
45
|
+
for parent in range(parents):
|
46
|
+
try:
|
47
|
+
path = Path(starting_path).parents[parent].absolute()
|
48
|
+
|
49
|
+
tmp = os.path.join(path, file_name)
|
50
|
+
paths.append(tmp)
|
51
|
+
if os.path.exists(tmp):
|
52
|
+
return tmp
|
53
|
+
except Exception as e:
|
54
|
+
print(f"Error {str(e)}")
|
55
|
+
print(f"Failed to find the file: {file_name}.")
|
56
|
+
print(f'Searched: {"\n".join(path)}.')
|
57
|
+
|
58
|
+
|
59
|
+
if raise_error_if_not_found:
|
60
|
+
searched_paths = "\n".join(paths)
|
61
|
+
raise RuntimeError(
|
62
|
+
f"Failed to locate environment file: {file_name} in: \n {searched_paths}"
|
63
|
+
)
|
64
|
+
|
65
|
+
return None
|
@@ -1,33 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024-2025 Aplos Analytics
|
3
|
-
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
|
-
Property of Aplos Analytics, Utah, USA
|
5
|
-
"""
|
6
|
-
|
7
|
-
import os
|
8
|
-
|
9
|
-
|
10
|
-
from aplos_nca_saas_sdk.utilities.environment_services import EnvironmentServices
|
11
|
-
|
12
|
-
|
13
|
-
class FileUtility:
|
14
|
-
"""General File Utilities"""
|
15
|
-
|
16
|
-
@staticmethod
|
17
|
-
def load_filepath(file_path: str) -> str:
|
18
|
-
"""Load the file_path"""
|
19
|
-
if not file_path:
|
20
|
-
raise RuntimeError("file_path is required")
|
21
|
-
elif file_path.startswith("${module}"):
|
22
|
-
# find the path
|
23
|
-
es: EnvironmentServices = EnvironmentServices()
|
24
|
-
root = es.find_module_path()
|
25
|
-
if not root:
|
26
|
-
raise RuntimeError(
|
27
|
-
"Unable to find the module path. Please use the ${module} syntax to define the file path"
|
28
|
-
)
|
29
|
-
file_path = file_path.replace("${module}", root)
|
30
|
-
|
31
|
-
# get the correct os path separator
|
32
|
-
file_path = os.path.normpath(file_path)
|
33
|
-
return file_path
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/docs/images/API_Configuration_blur.png
RENAMED
File without changes
|
File without changes
|
{aplos_nca_saas_sdk-0.0.22 → aplos_nca_saas_sdk-0.0.23}/docs/images/aplos-nca-commandline.png
RENAMED
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|