aplos-nca-saas-sdk 0.0.21__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.
Files changed (71) hide show
  1. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/PKG-INFO +1 -1
  2. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/devops/pypi/build.py +31 -8
  3. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/pyproject.toml +1 -2
  4. aplos_nca_saas_sdk-0.0.23/requirements.dev.txt +8 -0
  5. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/requirements.txt +1 -1
  6. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/nca_execution_config.py +1 -1
  7. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/utilities/commandline_args.py +4 -25
  8. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/utilities/environment_services.py +5 -26
  9. aplos_nca_saas_sdk-0.0.23/src/aplos_nca_saas_sdk/utilities/file_utility.py +65 -0
  10. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/version.py +1 -1
  11. aplos_nca_saas_sdk-0.0.21/requirements.dev.txt +0 -1
  12. aplos_nca_saas_sdk-0.0.21/src/aplos_nca_saas_sdk/utilities/file_utility.py +0 -33
  13. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/.gitignore +0 -0
  14. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/.pypirc +0 -0
  15. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/.vscode/launch.json +0 -0
  16. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/.vscode/settings.json +0 -0
  17. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/LICENSE +0 -0
  18. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/README.md +0 -0
  19. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/devops/pypi/readme.md +0 -0
  20. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/devops/requirements.txt +0 -0
  21. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/docs/images/API_Configuration_blur.png +0 -0
  22. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/docs/images/aplos-nca-commandline-cropped.png +0 -0
  23. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/docs/images/aplos-nca-commandline.png +0 -0
  24. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/mypy.ini +0 -0
  25. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/mypy_checks.py +0 -0
  26. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/readme.md +0 -0
  27. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/run-checks.sh +0 -0
  28. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/__init__.py +0 -0
  29. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/_config_base.py +0 -0
  30. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/app_settings_config.py +0 -0
  31. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/config_sample.json +0 -0
  32. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/file_upload_config.py +0 -0
  33. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/login_config.py +0 -0
  34. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/configs/nca_validation_config.py +0 -0
  35. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/example_main.py +0 -0
  36. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/executions/config1.json +0 -0
  37. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.csv +0 -0
  38. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.dat +0 -0
  39. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.sas7bdat +0 -0
  40. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xls +0 -0
  41. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xlsx +0 -0
  42. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xpt +0 -0
  43. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_base.py +0 -0
  44. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_configurations.py +0 -0
  45. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_factory.py +0 -0
  46. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_response.py +0 -0
  47. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/integration_test_suite.py +0 -0
  48. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/readme.md +0 -0
  49. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py +0 -0
  50. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py +0 -0
  51. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/file_upload_test.py +0 -0
  52. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/nca_analysis_test.py +0 -0
  53. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/integration_testing/tests/nca_analysis_validation_test.py +0 -0
  54. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/_api_base.py +0 -0
  55. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/aws_cognito.py +0 -0
  56. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/aws_s3_presigned_payload.py +0 -0
  57. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/aws_s3_presigned_upload.py +0 -0
  58. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_analysis.py +0 -0
  59. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_app_configuration.py +0 -0
  60. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_authenticator.py +0 -0
  61. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_endpoints.py +0 -0
  62. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_file_download.py +0 -0
  63. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_file_upload.py +0 -0
  64. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/nca_resources/nca_validations.py +0 -0
  65. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/run_analysis_execution.py +0 -0
  66. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/config.json +0 -0
  67. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/input.csv +0 -0
  68. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/meta_data.json +0 -0
  69. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/utilities/environment_vars.py +0 -0
  70. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/src/aplos_nca_saas_sdk/utilities/http_utility.py +0 -0
  71. {aplos_nca_saas_sdk-0.0.21 → aplos_nca_saas_sdk-0.0.23}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aplos_nca_saas_sdk
3
- Version: 0.0.21
3
+ Version: 0.0.23
4
4
  Summary: Aplos NCA SaaS SDK
5
5
  Project-URL: Homepage, https://aplosanalytics.com/
6
6
  Project-URL: Documentation, https://docs.aplosanalytics.com/
@@ -15,7 +15,7 @@ def main():
15
15
  """build the artifacts"""
16
16
  project_root = Path(__file__).parents[2]
17
17
 
18
- # extact the version
18
+ # extract the version
19
19
  pyproject_toml = os.path.join(project_root, "pyproject.toml")
20
20
  version_file = os.path.join(project_root, "src", "aplos_nca_saas_sdk", "version.py")
21
21
 
@@ -72,7 +72,7 @@ def extract_version_and_write_to_file(pyproject_toml: str, version_file: str):
72
72
 
73
73
  def run_build():
74
74
  """Run python build commands"""
75
- run_commands(["python", "-m", "build"])
75
+ output = run_commands(["python", "-m", "build"], capture_output=True)
76
76
 
77
77
 
78
78
  def run_publish():
@@ -104,7 +104,7 @@ def get_url(payload: str):
104
104
 
105
105
  def run_commands(
106
106
  commands: List[str], capture_output: bool = False, env=None
107
- ) -> str | None:
107
+ ) -> str | int | None:
108
108
  """centralized area for running process commands"""
109
109
  try:
110
110
  # Run the publish command
@@ -113,16 +113,39 @@ def run_commands(
113
113
  check=True,
114
114
  capture_output=capture_output,
115
115
  env=env, # pass any environment vars
116
+ # capture errors
117
+ stderr=subprocess.PIPE if not capture_output else None,
118
+ # capture output
119
+ stdout=subprocess.PIPE if not capture_output else None,
120
+ text=True,
116
121
  )
117
122
 
118
- if capture_output:
119
- output = result.stdout.decode().strip()
120
- print(output)
121
- return output
123
+ # if capture_output:
124
+ output = str(result.stdout)
125
+ print(output)
126
+ return output
122
127
 
123
128
  except subprocess.CalledProcessError as e:
124
129
  logger.exception(f"An error occurred: {e}")
125
-
130
+ if e.stderr:
131
+ error = str(e.stderr)
132
+ if "401 Error" in error:
133
+ logger.error("401 Error: Invalid credentials")
134
+ if "amazonaws" in error:
135
+ logger.error(
136
+ "Please check your AWS credentials and try again."
137
+ )
138
+ print("🚨 If you this package doesn't use aws code artifact, check your pip config file "
139
+ "and remove the aws code artifact reference "
140
+ "mac: ~./.config/pip/pip.conf"
141
+ )
142
+ else:
143
+ logger.error(
144
+ "Please check your PYPI_API_TOKEN environment variable."
145
+ )
146
+
147
+ logger.error("If you need help, please contact support.")
148
+ return e.returncode
126
149
 
127
150
  if __name__ == "__main__":
128
151
  main()
@@ -7,7 +7,6 @@ packages = ["src/aplos_nca_saas_sdk"]
7
7
 
8
8
  [project]
9
9
  name = "aplos_nca_saas_sdk"
10
- source = "src/aplos_nca_saas_sdk"
11
10
  keywords = [
12
11
  "PK Analysis",
13
12
  "Pharmacokinetics",
@@ -26,7 +25,7 @@ keywords = [
26
25
  "Clinical Trials"
27
26
  ]
28
27
 
29
- version = "0.0.21"
28
+ version = "0.0.23"
30
29
  authors = [
31
30
  { name="Eric Wilson", email="eric.wilson@aplosanalytics.com" }
32
31
  ]
@@ -0,0 +1,8 @@
1
+ mypy
2
+ pytest
3
+ types-python-dateutil
4
+ build
5
+ toml
6
+ twine
7
+ wheel
8
+ pkginfo
@@ -3,5 +3,5 @@ boto3
3
3
  python-dotenv # load env values
4
4
  PyJWT # jwt in the imports
5
5
  requests
6
- boto3-stubs[cognito]
6
+ boto3-stubs
7
7
  mypy_boto3_cognito_idp
@@ -194,7 +194,7 @@ class NCAExecutionConfigs(ConfigBase):
194
194
  raise RuntimeError("Failed to load the config data")
195
195
 
196
196
  meta_data = self.__load_dictionary_data_or_file(key="meta", analysis=analysis, optional=True)
197
- data_cleaning = self.__load_dictionary_data_or_file(key="data_cleaning", analysis=analysis, optional=True)
197
+ data_cleaning = self.__load_dictionary_data_or_file(key="data_processing", analysis=analysis, optional=True)
198
198
  post_processing = self.__load_dictionary_data_or_file(key="post_processing", analysis=analysis, optional=True)
199
199
  wait_for_results =str(analysis.get("wait_for_results", True)).lower() == "true"
200
200
  max_wait_in_seconds = int(analysis.get("max_wait_in_seconds", 600))
@@ -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
- def find_file(
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
- file = self.find_file(__file__, env_file_path.name)
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
- environment_file: str | None = self.find_file(
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
- def find_file(
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,4 +1,4 @@
1
1
  # Aplos NCA SaaS SDK Version File
2
2
  # This is automatically generated during the build process.
3
3
  # DO NOT UPDATE IT DIRECTLY. IT WILL BE OVERWRITTEN.
4
- __version__ = '0.0.21'
4
+ __version__ = '0.0.23'
@@ -1 +0,0 @@
1
- mypy
@@ -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