orionis 0.418.0__py3-none-any.whl → 0.420.0__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.
Files changed (136) hide show
  1. orionis/metadata/framework.py +1 -1
  2. {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/METADATA +1 -1
  3. {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/RECORD +58 -133
  4. {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/top_level.txt +0 -1
  5. tests/foundation/config/app/test_foundation_config_app.py +262 -0
  6. {foundation → tests/foundation}/config/cache/test_foundation_config_cache_file.py +8 -8
  7. {foundation → tests/foundation}/config/cache/test_foundation_config_cache_stores.py +11 -3
  8. {foundation → tests/foundation}/config/database/test_foundation_config_database_pgsql.py +5 -5
  9. {foundation → tests/foundation}/config/queue/test_foundation_config_queue.py +0 -20
  10. {foundation → tests/foundation}/config/queue/test_foundation_config_queue_brokers.py +0 -13
  11. tests/foundation/config/root/test_foundation_config_root_paths.py +116 -0
  12. tests/foundation/config/startup/test_foundation_config_startup.py +199 -0
  13. foundation/config/app/test_foundation_config_app.py +0 -150
  14. foundation/config/root/test_foundation_config_root_paths.py +0 -201
  15. foundation/config/startup/test_foundation_config_startup.py +0 -205
  16. foundation/exceptions/__init__.py +0 -0
  17. foundation/exceptions/test_foundation_config_exceptions.py +0 -117
  18. orionis/_contracts/__init__.py +0 -0
  19. orionis/_contracts/application.py +0 -41
  20. orionis/_contracts/config/__init__.py +0 -0
  21. orionis/_contracts/config/config.py +0 -27
  22. orionis/_contracts/console/__init__.py +0 -0
  23. orionis/_contracts/console/base/__init__.py +0 -0
  24. orionis/_contracts/console/base/command.py +0 -437
  25. orionis/_contracts/console/command_filter.py +0 -32
  26. orionis/_contracts/console/kernel.py +0 -32
  27. orionis/_contracts/console/output/__init__.py +0 -0
  28. orionis/_contracts/console/output/console.py +0 -421
  29. orionis/_contracts/console/output/executor.py +0 -51
  30. orionis/_contracts/console/parser.py +0 -75
  31. orionis/_contracts/console/task_manager.py +0 -37
  32. orionis/_contracts/facades/__init__.py +0 -0
  33. orionis/_contracts/facades/commands/__init__.py +0 -0
  34. orionis/_contracts/facades/commands/commands_facade.py +0 -40
  35. orionis/_contracts/facades/commands/scheduler_facade.py +0 -28
  36. orionis/_contracts/facades/config/__init__.py +0 -0
  37. orionis/_contracts/facades/config/config_facade.py +0 -37
  38. orionis/_contracts/facades/environment/__init__.py +0 -0
  39. orionis/_contracts/facades/environment/environment_facade.py +0 -74
  40. orionis/_contracts/facades/facade.py +0 -38
  41. orionis/_contracts/facades/files/__init__.py +0 -0
  42. orionis/_contracts/facades/files/path_facade.py +0 -148
  43. orionis/_contracts/facades/log/__init__.py +0 -0
  44. orionis/_contracts/facades/log/log_facade.py +0 -83
  45. orionis/_contracts/facades/tests/__init__.py +0 -0
  46. orionis/_contracts/facades/tests/tests_facade.py +0 -30
  47. orionis/_contracts/foundation/__init__.py +0 -0
  48. orionis/_contracts/foundation/bootstraper.py +0 -41
  49. orionis/_contracts/foundation/config/__init__.py +0 -0
  50. orionis/_contracts/foundation/config/config_bootstrapper.py +0 -140
  51. orionis/_contracts/foundation/console/__init__.py +0 -0
  52. orionis/_contracts/foundation/console/command_bootstrapper.py +0 -81
  53. orionis/_contracts/foundation/environment/__init__.py +0 -0
  54. orionis/_contracts/foundation/environment/environment_bootstrapper.py +0 -33
  55. orionis/_contracts/foundation/providers/__init__.py +0 -0
  56. orionis/_contracts/foundation/providers/service_providers_bootstrapper.py +0 -47
  57. orionis/_contracts/providers/__init__.py +0 -0
  58. orionis/_contracts/providers/service_provider.py +0 -14
  59. orionis/_contracts/services/__init__.py +0 -0
  60. orionis/_contracts/services/commands/__init__.py +0 -0
  61. orionis/_contracts/services/commands/reactor_commands_service.py +0 -23
  62. orionis/_contracts/services/commands/schedule_service.py +0 -317
  63. orionis/_contracts/services/config/__init__.py +0 -0
  64. orionis/_contracts/services/config/config_service.py +0 -37
  65. orionis/_contracts/services/environment/__init__.py +0 -0
  66. orionis/_contracts/services/environment/environment_service.py +0 -74
  67. orionis/_contracts/services/files/__init__.py +0 -0
  68. orionis/_contracts/services/files/path_resolver_service.py +0 -29
  69. orionis/_contracts/services/log/__init__.py +0 -0
  70. orionis/_contracts/services/log/log_service.py +0 -89
  71. orionis/_contracts/support/exception_parse.py +0 -26
  72. orionis/_contracts/support/reflection.py +0 -352
  73. orionis/_foundation/__init__.py +0 -0
  74. orionis/_foundation/console/__init__.py +0 -0
  75. orionis/_foundation/console/command_bootstrapper.py +0 -175
  76. orionis/_foundation/environment/__init__.py +0 -0
  77. orionis/_foundation/environment/environment_bootstrapper.py +0 -76
  78. orionis/_foundation/exceptions/__init__.py +0 -0
  79. orionis/_foundation/exceptions/exception_bootstrapper.py +0 -54
  80. orionis/_foundation/exceptions/exception_providers.py +0 -54
  81. orionis/_foundation/foundation/config/__init__.py +0 -0
  82. orionis/_foundation/foundation/config/config_bootstrapper.py +0 -209
  83. orionis/_foundation/providers/__init__.py +0 -0
  84. orionis/_foundation/providers/service_providers_bootstrapper.py +0 -107
  85. orionis/_services/__init__.py +0 -0
  86. orionis/_services/commands/__init__.py +0 -0
  87. orionis/_services/commands/reactor_commands_service.py +0 -148
  88. orionis/_services/commands/scheduler_service.py +0 -611
  89. orionis/_services/config/__init__.py +0 -0
  90. orionis/_services/config/config_service.py +0 -72
  91. {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/WHEEL +0 -0
  92. {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/licenses/LICENCE +0 -0
  93. {orionis-0.418.0.dist-info → orionis-0.420.0.dist-info}/zip-safe +0 -0
  94. {foundation → tests/foundation}/__init__.py +0 -0
  95. {foundation → tests/foundation}/config/__init__.py +0 -0
  96. {foundation → tests/foundation}/config/app/__init__.py +0 -0
  97. {foundation → tests/foundation}/config/auth/__init__.py +0 -0
  98. {foundation → tests/foundation}/config/auth/test_foundation_config_auth.py +0 -0
  99. {foundation → tests/foundation}/config/cache/__init__.py +0 -0
  100. {foundation → tests/foundation}/config/cache/test_foundation_config_cache.py +0 -0
  101. {foundation → tests/foundation}/config/cors/__init__.py +0 -0
  102. {foundation → tests/foundation}/config/cors/test_foundation_config_cors.py +0 -0
  103. {foundation → tests/foundation}/config/database/__init__.py +0 -0
  104. {foundation → tests/foundation}/config/database/test_foundation_config_database.py +0 -0
  105. {foundation → tests/foundation}/config/database/test_foundation_config_database_connections.py +0 -0
  106. {foundation → tests/foundation}/config/database/test_foundation_config_database_mysql.py +0 -0
  107. {foundation → tests/foundation}/config/database/test_foundation_config_database_oracle.py +0 -0
  108. {foundation → tests/foundation}/config/database/test_foundation_config_database_sqlite.py +0 -0
  109. {foundation → tests/foundation}/config/filesystems/__init__.py +0 -0
  110. {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems.py +0 -0
  111. {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems_aws.py +0 -0
  112. {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems_disks.py +0 -0
  113. {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems_local.py +0 -0
  114. {foundation → tests/foundation}/config/filesystems/test_foundation_config_filesystems_public.py +0 -0
  115. {foundation → tests/foundation}/config/logging/__init__.py +0 -0
  116. {foundation → tests/foundation}/config/logging/test_foundation_config_logging.py +0 -0
  117. {foundation → tests/foundation}/config/logging/test_foundation_config_logging_channels.py +0 -0
  118. {foundation → tests/foundation}/config/logging/test_foundation_config_logging_chunked.py +0 -0
  119. {foundation → tests/foundation}/config/logging/test_foundation_config_logging_daily.py +0 -0
  120. {foundation → tests/foundation}/config/logging/test_foundation_config_logging_hourly.py +0 -0
  121. {foundation → tests/foundation}/config/logging/test_foundation_config_logging_monthly.py +0 -0
  122. {foundation → tests/foundation}/config/logging/test_foundation_config_logging_stack.py +0 -0
  123. {foundation → tests/foundation}/config/logging/test_foundation_config_logging_weekly.py +0 -0
  124. {foundation → tests/foundation}/config/mail/__init__.py +0 -0
  125. {foundation → tests/foundation}/config/mail/test_foundation_config_mail.py +0 -0
  126. {foundation → tests/foundation}/config/mail/test_foundation_config_mail_file.py +0 -0
  127. {foundation → tests/foundation}/config/mail/test_foundation_config_mail_mailers.py +0 -0
  128. {foundation → tests/foundation}/config/mail/test_foundation_config_mail_smtp.py +0 -0
  129. {foundation → tests/foundation}/config/queue/__init__.py +0 -0
  130. {foundation → tests/foundation}/config/queue/test_foundation_config_queue_database.py +0 -0
  131. {foundation → tests/foundation}/config/root/__init__.py +0 -0
  132. {foundation → tests/foundation}/config/session/__init__.py +0 -0
  133. {foundation → tests/foundation}/config/session/test_foundation_config_session.py +0 -0
  134. {foundation → tests/foundation}/config/startup/__init__.py +0 -0
  135. {foundation → tests/foundation}/config/testing/__init__.py +0 -0
  136. {foundation → tests/foundation}/config/testing/test_foundation_config_testing.py +0 -0
@@ -1,47 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import List, Type
3
- from orionis._contracts.providers.service_provider import IServiceProvider
4
- from orionis._providers.service_provider import ServiceProvider
5
-
6
- class IServiceProvidersBootstrapper(ABC):
7
-
8
- @abstractmethod
9
- def _autoload(self) -> None:
10
- """
11
- Scans the provider directories and loads provider classes.
12
-
13
- This method searches for Python files in the specified directories, imports them,
14
- and registers any class that inherits from `ServiceProvider`.
15
-
16
- Raises
17
- ------
18
- BootstrapRuntimeError
19
- If there is an error loading a module.
20
- """
21
- pass
22
-
23
- @abstractmethod
24
- def _register(self, concrete: Type[IServiceProvider]) -> None:
25
- """
26
- Validates and registers a service provider class.
27
-
28
- This method ensures that the provided class is valid (inherits from `ServiceProvider`,
29
- has a `register` and `boot` method) and registers it in the
30
- `_service_providers` dictionary.
31
-
32
- Parameters
33
- ----------
34
- concrete : ServiceProvider
35
- The service provider class to register
36
- """
37
- pass
38
-
39
- @abstractmethod
40
- def get(self) -> List[Type[IServiceProvider]]:
41
- """
42
- Retrieve the registered service providers that should run before bootstrapping.
43
-
44
- Returns:
45
- List[Type[IServiceProvider]]: A list of service providers to run before bootstrapping.
46
- """
47
- pass
File without changes
@@ -1,14 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from orionis._container.container import Container
3
-
4
- class IServiceProvider(ABC):
5
-
6
- @abstractmethod
7
- def register(self, container: Container) -> None:
8
- """
9
- Registers services or bindings into the given container.
10
-
11
- Args:
12
- container (Container): The container to register services or bindings into.
13
- """
14
- pass
File without changes
File without changes
@@ -1,23 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Optional
3
-
4
- class IReactorCommandsService(ABC):
5
- """
6
- Interface for the ReactorCommandsService class.
7
- Service responsible for executing and managing CLI commands in Orionis.
8
-
9
- This service handles:
10
- - Parsing command arguments.
11
- - Executing commands and logging their output.
12
- - Managing execution timing and error handling.
13
- """
14
-
15
- @abstractmethod
16
- def execute(self, signature: Optional[str] = None, vars: dict = {}, *args, **kwargs):
17
- """
18
- Processes and executes a CLI command.
19
-
20
- Determines if the command originates from `sys.argv` or is explicitly called,
21
- then executes the appropriate command pipeline, handling success and errors.
22
- """
23
- pass
@@ -1,317 +0,0 @@
1
-
2
- from typing import Any
3
- from datetime import datetime
4
- from abc import ABC, abstractmethod
5
-
6
- class IScheduleService(ABC):
7
- """
8
- A class that manages the scheduling of tasks using the APScheduler.
9
-
10
- Attributes
11
- ----------
12
- scheduler : BackgroundScheduler
13
- The background scheduler instance used to schedule tasks.
14
- callback : function | None
15
- A callback function that will be called when the scheduled task is triggered.
16
-
17
- Methods
18
- -------
19
- command(signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any) -> 'Schedule':
20
- Defines a command to execute.
21
- """
22
-
23
- @abstractmethod
24
- def command(self, signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any):
25
- """
26
- Defines a Orionis command to be executed.
27
-
28
- Parameters
29
- ----------
30
- signature : str
31
- The signature of the command to execute.
32
- vars : dict, optional
33
- A dictionary of variables to pass to the command, by default an empty dictionary.
34
- *args : Any
35
- Additional positional arguments to pass to the command.
36
- **kwargs : Any
37
- Additional keyword arguments to pass to the command.
38
-
39
- Returns
40
- -------
41
- Schedule
42
- Returns the Schedule instance itself, allowing method chaining.
43
- """
44
- pass
45
-
46
- @abstractmethod
47
- def onceAt(self, date: datetime):
48
- """
49
- Schedule the defined command to execute every X seconds.
50
- """
51
- pass
52
-
53
- @abstractmethod
54
- def everySeconds(self, seconds: int, start_date: datetime = None, end_date: datetime = None):
55
- """
56
- Schedule the defined command to execute every X seconds.
57
- """
58
- pass
59
-
60
- @abstractmethod
61
- def everySecond(self, start_date: datetime = None, end_date: datetime = None):
62
- """
63
- Schedules the defined command to execute every second.
64
- """
65
- pass
66
-
67
- @abstractmethod
68
- def everyTwoSeconds(self, start_date: datetime = None, end_date: datetime = None):
69
- """
70
- Schedules the defined command to execute every two seconds.
71
- """
72
- pass
73
-
74
- @abstractmethod
75
- def everyFiveSeconds(self, start_date: datetime = None, end_date: datetime = None):
76
- """
77
- Schedules the defined command to execute every five seconds.
78
- """
79
- pass
80
-
81
- @abstractmethod
82
- def everyTenSeconds(self, start_date: datetime = None, end_date: datetime = None):
83
- """
84
- Schedules the defined command to execute every ten seconds.
85
- """
86
- pass
87
-
88
- @abstractmethod
89
- def everyFifteenSeconds(self, start_date: datetime = None, end_date: datetime = None):
90
- """
91
- Schedules the defined command to execute every fifteen seconds.
92
- """
93
- pass
94
-
95
- @abstractmethod
96
- def everyTwentySeconds(self, start_date: datetime = None, end_date: datetime = None):
97
- """
98
- Schedules the defined command to execute every twenty seconds.
99
- """
100
- pass
101
-
102
- @abstractmethod
103
- def everyThirtySeconds(self, start_date: datetime = None, end_date: datetime = None):
104
- """
105
- Schedules the defined command to execute every thirty seconds.
106
- """
107
- pass
108
-
109
- @abstractmethod
110
- def everyMinutes(self, minutes: int, start_date: datetime = None, end_date: datetime = None):
111
- """
112
- Schedules the defined command to execute every X minutes.
113
- """
114
- pass
115
-
116
- @abstractmethod
117
- def everyMinute(self, start_date: datetime = None, end_date: datetime = None):
118
- """
119
- Schedules the defined command to execute every minute.
120
- """
121
- pass
122
-
123
- @abstractmethod
124
- def everyTwoMinutes(self, start_date: datetime = None, end_date: datetime = None):
125
- """
126
- Schedules the defined command to execute every two minutes.
127
- """
128
- pass
129
-
130
- @abstractmethod
131
- def everyThreeMinutes(self, start_date: datetime = None, end_date: datetime = None):
132
- """
133
- Schedules the defined command to execute every three minutes.
134
- """
135
- pass
136
-
137
- @abstractmethod
138
- def everyFourMinutes(self, start_date: datetime = None, end_date: datetime = None):
139
- """
140
- Schedules the defined command to execute every four minutes.
141
- """
142
- pass
143
-
144
- @abstractmethod
145
- def everyFiveMinutes(self, start_date: datetime = None, end_date: datetime = None):
146
- """
147
- Schedules the defined command to execute every five minutes.
148
- """
149
- pass
150
-
151
- @abstractmethod
152
- def everyTenMinutes(self, start_date: datetime = None, end_date: datetime = None):
153
- """
154
- Schedules the defined command to execute every ten minutes.
155
- """
156
- pass
157
-
158
- @abstractmethod
159
- def everyFifteenMinutes(self, start_date: datetime = None, end_date: datetime = None):
160
- """
161
- Schedules the defined command to execute every fifteen minutes.
162
- """
163
- pass
164
-
165
- @abstractmethod
166
- def everyThirtyMinutes(self, start_date: datetime = None, end_date: datetime = None):
167
- """
168
- Schedules the defined command to execute every thirty minutes.
169
- """
170
- pass
171
-
172
- @abstractmethod
173
- def hours(self, hours: int, start_date: datetime = None, end_date: datetime = None):
174
- """
175
- Schedules the defined command to execute every X hours.
176
- """
177
- pass
178
-
179
- @abstractmethod
180
- def hourly(self, start_date: datetime = None, end_date: datetime = None):
181
- """
182
- Schedules the defined command to execute every hour.
183
- """
184
- pass
185
-
186
- @abstractmethod
187
- def hourlyAt(self, minute: int, start_date: datetime = None, end_date: datetime = None):
188
- """
189
- Schedules the defined command to execute every hour at a specific minute.
190
- """
191
- pass
192
-
193
- @abstractmethod
194
- def everyOddHour(self, minute: int, start_date: datetime = None, end_date: datetime = None):
195
- """
196
- Schedules the defined command to execute every odd hour.
197
- """
198
- pass
199
-
200
- @abstractmethod
201
- def everyTwoHours(self, minute: int, start_date: datetime = None, end_date: datetime = None):
202
- """
203
- Schedules the defined command to execute every two hours.
204
- """
205
- pass
206
-
207
- @abstractmethod
208
- def everyThreeHours(self, minute: int, start_date: datetime = None, end_date: datetime = None):
209
- """
210
- Schedules the defined command to execute every three hours.
211
- """
212
- pass
213
-
214
- @abstractmethod
215
- def everyFourHours(self, minute: int, start_date: datetime = None, end_date: datetime = None):
216
- """
217
- Schedules the defined command to execute every four hours.
218
- """
219
- pass
220
-
221
- @abstractmethod
222
- def everySixHours(self, minute: int, start_date: datetime = None, end_date: datetime = None):
223
- """
224
- Schedules the defined command to execute every six hours.
225
- """
226
- pass
227
-
228
- @abstractmethod
229
- def days(self, days: int, start_date: datetime = None, end_date: datetime = None):
230
- """
231
- Schedules the defined command to execute every X days.
232
- """
233
- pass
234
-
235
- @abstractmethod
236
- def daily(self, start_date: datetime = None, end_date: datetime = None):
237
- """
238
- Schedules the defined command to execute daily at midnight.
239
- """
240
- pass
241
-
242
- @abstractmethod
243
- def dailyAt(self, at: str, start_date: datetime = None, end_date: datetime = None):
244
- """
245
- Schedules the defined command to execute daily at a specific time.
246
- """
247
- pass
248
-
249
- @abstractmethod
250
- def twiceDaily(self, first_hour: int, second_hour: int, start_date: datetime = None, end_date: datetime = None):
251
- """
252
- Schedules the defined command to execute twice a day at specific hours.
253
- """
254
- pass
255
-
256
- @abstractmethod
257
- def monday(self, at: str, start_date: datetime = None, end_date: datetime = None):
258
- """
259
- Schedules the defined command to execute every Monday at a specific time.
260
- """
261
- pass
262
-
263
- @abstractmethod
264
- def tuesday(self, at: str, start_date: datetime = None, end_date: datetime = None):
265
- """
266
- Schedules the defined command to execute every tuesday at a specific time.
267
- """
268
- pass
269
-
270
- @abstractmethod
271
- def wednesday(self, at: str, start_date: datetime = None, end_date: datetime = None):
272
- """
273
- Schedules the defined command to execute every wednesday at a specific time.
274
- """
275
- pass
276
-
277
- @abstractmethod
278
- def thursday(self, at: str, start_date: datetime = None, end_date: datetime = None):
279
- """
280
- Schedules the defined command to execute every thursday at a specific time.
281
- """
282
- pass
283
-
284
- @abstractmethod
285
- def friday(self, at: str, start_date: datetime = None, end_date: datetime = None):
286
- """
287
- Schedules the defined command to execute every friday at a specific time.
288
- """
289
- pass
290
-
291
- @abstractmethod
292
- def saturday(self, at: str, start_date: datetime = None, end_date: datetime = None):
293
- """
294
- Schedules the defined command to execute every saturday at a specific time.
295
- """
296
- pass
297
-
298
- @abstractmethod
299
- def sunday(self, at: str, start_date: datetime = None, end_date: datetime = None):
300
- """
301
- Schedules the defined command to execute every sunday at a specific time.
302
- """
303
- pass
304
-
305
- @abstractmethod
306
- def weekly(self, start_date: datetime = None, end_date: datetime = None):
307
- """
308
- Schedules the defined command to execute weekly on Sunday at midnight.
309
- """
310
- pass
311
-
312
- @abstractmethod
313
- def start(self):
314
- """
315
- Starts the scheduler and stops automatically when there are no more jobs.
316
- """
317
- pass
File without changes
@@ -1,37 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Any, Optional
3
-
4
- class IConfigService(ABC):
5
-
6
- @abstractmethod
7
- def set(self, key: str, value: Any) -> None:
8
- """
9
- Dynamically sets a configuration value using dot notation.
10
-
11
- Parameters
12
- ----------
13
- key : str
14
- The configuration key (e.g., 'app.debug').
15
- value : Any
16
- The value to set.
17
- """
18
- pass
19
-
20
- @abstractmethod
21
- def get(self, key: str, default: Optional[Any] = None) -> Any:
22
- """
23
- Retrieves a configuration value using dot notation.
24
-
25
- Parameters
26
- ----------
27
- key : str
28
- The configuration key (e.g., 'app.debug').
29
- default : Optional[Any]
30
- The default value to return if the key is not found.
31
-
32
- Returns
33
- -------
34
- Any
35
- The configuration value or the default value if the key is not found.
36
- """
37
- pass
File without changes
@@ -1,74 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- class IEnvironmentService(ABC):
4
-
5
- @abstractmethod
6
- def _initialize(self, path: str = None):
7
- """
8
- Initializes the instance by setting the path to the .env file.
9
- If no path is provided, defaults to a `.env` file in the current directory.
10
-
11
- Parameters
12
- ----------
13
- path : str, optional
14
- Path to the .env file. Defaults to None.
15
- """
16
- pass
17
-
18
- @abstractmethod
19
- def get(self, key: str, default=None) -> str:
20
- """
21
- Retrieves the value of an environment variable from the .env file
22
- or from system environment variables if not found.
23
-
24
- Parameters
25
- ----------
26
- key : str
27
- The key of the environment variable.
28
- default : optional
29
- Default value if the key does not exist. Defaults to None.
30
-
31
- Returns
32
- -------
33
- str
34
- The value of the environment variable or the default value.
35
- """
36
- pass
37
-
38
- @abstractmethod
39
- def set(self, key: str, value: str) -> None:
40
- """
41
- Sets the value of an environment variable in the .env file.
42
-
43
- Parameters
44
- ----------
45
- key : str
46
- The key of the environment variable.
47
- value : str
48
- The value to set.
49
- """
50
- pass
51
-
52
- @abstractmethod
53
- def unset(self, key: str) -> None:
54
- """
55
- Removes an environment variable from the .env file.
56
-
57
- Parameters
58
- ----------
59
- key : str
60
- The key of the environment variable to remove.
61
- """
62
- pass
63
-
64
- @abstractmethod
65
- def all(self) -> dict:
66
- """
67
- Retrieves all environment variable values from the .env file.
68
-
69
- Returns
70
- -------
71
- dict
72
- A dictionary of all environment variables and their values.
73
- """
74
- pass
File without changes
@@ -1,29 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- class IPathResolverService(ABC):
4
-
5
- @abstractmethod
6
- def resolve(self, route: str) -> str:
7
- """
8
- Resolves and returns the absolute path as a string.
9
-
10
- This method combines the base path (current working directory) with the provided
11
- relative path, resolves it to an absolute path, and validates that it exists
12
- and is either a directory or a file.
13
-
14
- Parameters
15
- ----------
16
- route : str
17
- The relative directory or file path to be resolved.
18
-
19
- Returns
20
- -------
21
- str
22
- The absolute path to the directory or file.
23
-
24
- Raises
25
- ------
26
- ValueError
27
- If the resolved path does not exist or is neither a directory nor a file.
28
- """
29
- pass
File without changes
@@ -1,89 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Optional
3
-
4
- class ILogguerService(ABC):
5
-
6
- @abstractmethod
7
- def _initialize_logger(self, path: Optional[str], level: int, filename: Optional[str] = 'orionis.log'):
8
- """
9
- Configures the logger with the specified settings.
10
-
11
- This method sets up the logger to write logs to a file. If the specified
12
- directory does not exist, it creates it. The log format includes the
13
- timestamp and the log message.
14
-
15
- Parameters
16
- ----------
17
- path : Optional[str]
18
- The directory path where the log file will be stored.
19
- level : int
20
- The logging level (e.g., logging.INFO, logging.ERROR).
21
- filename : Optional[str]
22
- The name of the log file.
23
-
24
- Raises
25
- ------
26
- RuntimeError
27
- If the logger cannot be initialized due to an error.
28
- """
29
- pass
30
-
31
- @abstractmethod
32
- def info(self, message: str) -> None:
33
- """
34
- Logs an informational message.
35
-
36
- Parameters
37
- ----------
38
- message : str
39
- The message to log.
40
- """
41
- pass
42
-
43
- @abstractmethod
44
- def error(self, message: str) -> None:
45
- """
46
- Logs an error message.
47
-
48
- Parameters
49
- ----------
50
- message : str
51
- The message to log.
52
- """
53
- pass
54
-
55
- @abstractmethod
56
- def success(self, message: str) -> None:
57
- """
58
- Logs a success message (treated as info).
59
-
60
- Parameters
61
- ----------
62
- message : str
63
- The message to log.
64
- """
65
- pass
66
-
67
- @abstractmethod
68
- def warning(self, message: str) -> None:
69
- """
70
- Logs a warning message.
71
-
72
- Parameters
73
- ----------
74
- message : str
75
- The message to log.
76
- """
77
- pass
78
-
79
- @abstractmethod
80
- def debug(self, message: str) -> None:
81
- """
82
- Logs a debug message.
83
-
84
- Parameters
85
- ----------
86
- message : str
87
- The message to log.
88
- """
89
- pass
@@ -1,26 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- class IExceptionParse(ABC):
4
-
5
- @abstractmethod
6
- def toDict(exception):
7
- """
8
- Parse the provided exception and serialize it into a dictionary format.
9
-
10
- Parameters
11
- ----------
12
- exception : Exception
13
- The exception object to be serialized.
14
-
15
- Returns
16
- -------
17
- dict
18
- A dictionary containing the exception details such as error type, message,
19
- and the stack trace.
20
-
21
- Notes
22
- -----
23
- - Uses `traceback.TracebackException.from_exception()` to extract detailed traceback information.
24
- - The stack trace includes filenames, line numbers, function names, and the exact line of code.
25
- """
26
- pass