orionis 0.1.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 (133) hide show
  1. orionis/__init__.py +0 -0
  2. orionis/cli_manager.py +48 -0
  3. orionis/framework.py +45 -0
  4. orionis/luminate/__init__.py +0 -0
  5. orionis/luminate/app.py +0 -0
  6. orionis/luminate/bootstrap/__init__.py +0 -0
  7. orionis/luminate/bootstrap/parser.py +49 -0
  8. orionis/luminate/bootstrap/register.py +95 -0
  9. orionis/luminate/cache/__init__.py +0 -0
  10. orionis/luminate/cache/app/__init__.py +0 -0
  11. orionis/luminate/cache/app/config.py +96 -0
  12. orionis/luminate/cache/console/__init__.py +0 -0
  13. orionis/luminate/cache/console/commands.py +98 -0
  14. orionis/luminate/config/__init__.py +0 -0
  15. orionis/luminate/config/dataclass/__init__.py +0 -0
  16. orionis/luminate/config/dataclass/app.py +50 -0
  17. orionis/luminate/config/dataclass/auth.py +17 -0
  18. orionis/luminate/config/dataclass/cache.py +51 -0
  19. orionis/luminate/config/dataclass/cors.py +58 -0
  20. orionis/luminate/config/dataclass/database.py +203 -0
  21. orionis/luminate/config/dataclass/filesystems.py +102 -0
  22. orionis/luminate/config/dataclass/logging.py +107 -0
  23. orionis/luminate/config/dataclass/mail.py +81 -0
  24. orionis/luminate/config/dataclass/queue.py +63 -0
  25. orionis/luminate/config/dataclass/session.py +59 -0
  26. orionis/luminate/config/environment.py +110 -0
  27. orionis/luminate/config/sections.py +37 -0
  28. orionis/luminate/console/__init__.py +0 -0
  29. orionis/luminate/console/base/__init__.py +0 -0
  30. orionis/luminate/console/base/command.py +427 -0
  31. orionis/luminate/console/cache.py +132 -0
  32. orionis/luminate/console/command.py +40 -0
  33. orionis/luminate/console/command_filter.py +40 -0
  34. orionis/luminate/console/commands/__init__.py +0 -0
  35. orionis/luminate/console/commands/cache_clear.py +56 -0
  36. orionis/luminate/console/commands/help.py +59 -0
  37. orionis/luminate/console/commands/schedule_work.py +50 -0
  38. orionis/luminate/console/commands/tests.py +40 -0
  39. orionis/luminate/console/commands/version.py +39 -0
  40. orionis/luminate/console/exceptions/__init__.py +0 -0
  41. orionis/luminate/console/exceptions/cli_exception.py +125 -0
  42. orionis/luminate/console/kernel.py +32 -0
  43. orionis/luminate/console/output/__init__.py +0 -0
  44. orionis/luminate/console/output/console.py +426 -0
  45. orionis/luminate/console/output/executor.py +90 -0
  46. orionis/luminate/console/output/progress_bar.py +100 -0
  47. orionis/luminate/console/output/styles.py +95 -0
  48. orionis/luminate/console/parser.py +159 -0
  49. orionis/luminate/console/register.py +98 -0
  50. orionis/luminate/console/runner.py +126 -0
  51. orionis/luminate/console/scripts/__init__.py +0 -0
  52. orionis/luminate/console/scripts/management.py +94 -0
  53. orionis/luminate/console/tasks/__init__.py +0 -0
  54. orionis/luminate/console/tasks/scheduler.py +616 -0
  55. orionis/luminate/contracts/__init__.py +0 -0
  56. orionis/luminate/contracts/bootstrap/parser_interface.py +46 -0
  57. orionis/luminate/contracts/cache/__init__.py +0 -0
  58. orionis/luminate/contracts/cache/cache_commands_interface.py +69 -0
  59. orionis/luminate/contracts/config/__init__.py +0 -0
  60. orionis/luminate/contracts/config/config_interface.py +27 -0
  61. orionis/luminate/contracts/config/environment_interface.py +64 -0
  62. orionis/luminate/contracts/console/__init__.py +0 -0
  63. orionis/luminate/contracts/console/base_command_interface.py +448 -0
  64. orionis/luminate/contracts/console/cli_cache_interface.py +34 -0
  65. orionis/luminate/contracts/console/command_filter_interface.py +32 -0
  66. orionis/luminate/contracts/console/command_interface.py +36 -0
  67. orionis/luminate/contracts/console/console_interface.py +305 -0
  68. orionis/luminate/contracts/console/executor_interface.py +51 -0
  69. orionis/luminate/contracts/console/kernel_interface.py +32 -0
  70. orionis/luminate/contracts/console/management_interface.py +63 -0
  71. orionis/luminate/contracts/console/parser_interface.py +76 -0
  72. orionis/luminate/contracts/console/progress_bar_interface.py +66 -0
  73. orionis/luminate/contracts/console/register_interface.py +32 -0
  74. orionis/luminate/contracts/console/runner_interface.py +50 -0
  75. orionis/luminate/contracts/console/schedule_interface.py +317 -0
  76. orionis/luminate/contracts/console/task_manager_interface.py +37 -0
  77. orionis/luminate/contracts/facades/__init__.py +0 -0
  78. orionis/luminate/contracts/facades/env_interface.py +64 -0
  79. orionis/luminate/contracts/facades/log_interface.py +48 -0
  80. orionis/luminate/contracts/facades/paths_interface.py +141 -0
  81. orionis/luminate/contracts/facades/tests_interface.py +33 -0
  82. orionis/luminate/contracts/files/__init__.py +0 -0
  83. orionis/luminate/contracts/files/paths_interface.py +29 -0
  84. orionis/luminate/contracts/installer/__init__.py +0 -0
  85. orionis/luminate/contracts/installer/output_interface.py +125 -0
  86. orionis/luminate/contracts/installer/setup_interface.py +29 -0
  87. orionis/luminate/contracts/installer/upgrade_interface.py +24 -0
  88. orionis/luminate/contracts/log/__init__.py +0 -0
  89. orionis/luminate/contracts/log/logger_interface.py +33 -0
  90. orionis/luminate/contracts/pipelines/cli_pipeline_interface.py +84 -0
  91. orionis/luminate/contracts/publisher/__init__.py +0 -0
  92. orionis/luminate/contracts/publisher/pypi_publisher_interface.py +36 -0
  93. orionis/luminate/contracts/test/__init__.py +0 -0
  94. orionis/luminate/contracts/test/unit_test_interface.py +51 -0
  95. orionis/luminate/contracts/tools/__init__.py +0 -0
  96. orionis/luminate/contracts/tools/reflection_interface.py +343 -0
  97. orionis/luminate/contracts/tools/std_interface.py +56 -0
  98. orionis/luminate/facades/__init__.py +0 -0
  99. orionis/luminate/facades/environment.py +81 -0
  100. orionis/luminate/facades/log.py +56 -0
  101. orionis/luminate/facades/paths.py +268 -0
  102. orionis/luminate/facades/tests.py +48 -0
  103. orionis/luminate/files/__init__.py +0 -0
  104. orionis/luminate/files/paths.py +56 -0
  105. orionis/luminate/installer/__init__.py +0 -0
  106. orionis/luminate/installer/icon.ascii +11 -0
  107. orionis/luminate/installer/info.ascii +13 -0
  108. orionis/luminate/installer/output.py +188 -0
  109. orionis/luminate/installer/setup.py +191 -0
  110. orionis/luminate/installer/upgrade.py +42 -0
  111. orionis/luminate/log/__init__.py +0 -0
  112. orionis/luminate/log/logger.py +116 -0
  113. orionis/luminate/pipelines/__init__.py +0 -0
  114. orionis/luminate/pipelines/cli_pipeline.py +116 -0
  115. orionis/luminate/publisher/__init__.py +0 -0
  116. orionis/luminate/publisher/pypi.py +206 -0
  117. orionis/luminate/static/logos/flaskavel.png +0 -0
  118. orionis/luminate/test/__init__.py +0 -0
  119. orionis/luminate/test/exception.py +48 -0
  120. orionis/luminate/test/unit_test.py +108 -0
  121. orionis/luminate/tools/__init__.py +0 -0
  122. orionis/luminate/tools/reflection.py +390 -0
  123. orionis/luminate/tools/std.py +53 -0
  124. orionis-0.1.0.dist-info/LICENCE +21 -0
  125. orionis-0.1.0.dist-info/METADATA +27 -0
  126. orionis-0.1.0.dist-info/RECORD +133 -0
  127. orionis-0.1.0.dist-info/WHEEL +5 -0
  128. orionis-0.1.0.dist-info/entry_points.txt +2 -0
  129. orionis-0.1.0.dist-info/top_level.txt +2 -0
  130. tests/__init__.py +0 -0
  131. tests/tools/__init__.py +0 -0
  132. tests/tools/class_example.py +50 -0
  133. tests/tools/test_reflection.py +128 -0
@@ -0,0 +1,343 @@
1
+ from abc import ABC, abstractmethod
2
+ from typing import Any, List, Optional
3
+
4
+ class IReflection(ABC):
5
+ """
6
+ Abstract base class for reflection operations on a Python class.
7
+ This interface defines the methods that any reflection class must implement.
8
+ """
9
+
10
+ @abstractmethod
11
+ def safeImport(self):
12
+ """
13
+ Safely imports the module and class as specified in the instance.
14
+ """
15
+ pass
16
+
17
+ @abstractmethod
18
+ def getFile(self) -> str:
19
+ """
20
+ Retrieves the file path where the class is defined.
21
+
22
+ Returns
23
+ -------
24
+ str
25
+ The file path of the class definition.
26
+ """
27
+ pass
28
+
29
+ @abstractmethod
30
+ def hasClass(self) -> bool:
31
+ """
32
+ Checks whether the class object is available.
33
+
34
+ Returns
35
+ -------
36
+ bool
37
+ True if the class is loaded, False otherwise.
38
+ """
39
+ pass
40
+
41
+ @abstractmethod
42
+ def hasMethod(self, method_name: str) -> bool:
43
+ """
44
+ Checks whether the specified method exists in the class.
45
+
46
+ Parameters
47
+ ----------
48
+ method_name : str
49
+ The name of the method to check.
50
+
51
+ Returns
52
+ -------
53
+ bool
54
+ True if the method exists, False otherwise.
55
+ """
56
+ pass
57
+
58
+ @abstractmethod
59
+ def hasProperty(self, prop: str) -> bool:
60
+ """
61
+ Checks whether the specified property exists in the class.
62
+
63
+ Parameters
64
+ ----------
65
+ prop : str
66
+ The name of the property to check.
67
+
68
+ Returns
69
+ -------
70
+ bool
71
+ True if the property exists, False otherwise.
72
+ """
73
+ pass
74
+
75
+ @abstractmethod
76
+ def hasConstant(self, constant: str) -> bool:
77
+ """
78
+ Checks whether the specified constant exists in the class.
79
+
80
+ Parameters
81
+ ----------
82
+ constant : str
83
+ The name of the constant to check.
84
+
85
+ Returns
86
+ -------
87
+ bool
88
+ True if the constant exists, False otherwise.
89
+ """
90
+ pass
91
+
92
+ @abstractmethod
93
+ def getAttributes(self) -> List[str]:
94
+ """
95
+ Retrieves a list of all attributes (including methods and properties) of the class.
96
+
97
+ Returns
98
+ -------
99
+ list
100
+ A list of attribute names in the class.
101
+ """
102
+ pass
103
+
104
+ @abstractmethod
105
+ def getConstructor(self):
106
+ """
107
+ Retrieves the constructor (__init__) of the class.
108
+
109
+ Returns
110
+ -------
111
+ function or None
112
+ The constructor method if available, otherwise None.
113
+ """
114
+ pass
115
+
116
+ @abstractmethod
117
+ def getDocComment(self) -> Optional[str]:
118
+ """
119
+ Retrieves the docstring of the class.
120
+
121
+ Returns
122
+ -------
123
+ str or None
124
+ The docstring of the class if available, otherwise None.
125
+ """
126
+ pass
127
+
128
+ @abstractmethod
129
+ def getFileName(self, remove_extension: bool = False) -> str:
130
+ """
131
+ Retrieves the file name where the class is defined.
132
+
133
+ Parameters
134
+ ----------
135
+ remove_extension : bool, optional
136
+ If True, the file extension will be removed from the filename. Default is False.
137
+
138
+ Returns
139
+ -------
140
+ str
141
+ The file name of the class definition.
142
+ """
143
+ pass
144
+
145
+ @abstractmethod
146
+ def getMethod(self, method_name: str):
147
+ """
148
+ Retrieves the specified method from the class.
149
+
150
+ Parameters
151
+ ----------
152
+ method_name : str
153
+ The name of the method to retrieve.
154
+
155
+ Returns
156
+ -------
157
+ function or None
158
+ The method if it exists, otherwise None.
159
+ """
160
+ pass
161
+
162
+ @abstractmethod
163
+ def getMethods(self) -> List[str]:
164
+ """
165
+ Retrieves a list of all methods in the class.
166
+
167
+ Returns
168
+ -------
169
+ list
170
+ A list of method names in the class.
171
+ """
172
+ pass
173
+
174
+ @abstractmethod
175
+ def getName(self) -> str:
176
+ """
177
+ Retrieves the name of the class.
178
+
179
+ Returns
180
+ -------
181
+ str or None
182
+ The name of the class if available, otherwise None.
183
+ """
184
+ pass
185
+
186
+ @abstractmethod
187
+ def getParentClass(self) -> Optional[tuple]:
188
+ """
189
+ Retrieves the parent classes (base classes) of the class.
190
+
191
+ Returns
192
+ -------
193
+ tuple or None
194
+ A tuple of base classes if available, otherwise None.
195
+ """
196
+ pass
197
+
198
+ @abstractmethod
199
+ def getProperties(self) -> List[str]:
200
+ """
201
+ Retrieves a list of all properties of the class.
202
+
203
+ Returns
204
+ -------
205
+ list
206
+ A list of property names in the class.
207
+ """
208
+ pass
209
+
210
+ @abstractmethod
211
+ def getProperty(self, prop: str):
212
+ """
213
+ Retrieves the specified property from the class.
214
+
215
+ Parameters
216
+ ----------
217
+ prop : str
218
+ The name of the property to retrieve.
219
+
220
+ Returns
221
+ -------
222
+ property or None
223
+ The property if it exists, otherwise None.
224
+ """
225
+ pass
226
+
227
+ @abstractmethod
228
+ def isAbstract(self) -> bool:
229
+ """
230
+ Checks whether the class is abstract.
231
+
232
+ Returns
233
+ -------
234
+ bool
235
+ True if the class is abstract, False otherwise.
236
+ """
237
+ pass
238
+
239
+ @abstractmethod
240
+ def isEnum(self) -> bool:
241
+ """
242
+ Checks whether the class is an enumeration.
243
+
244
+ Returns
245
+ -------
246
+ bool
247
+ True if the class is a subclass of Enum, False otherwise.
248
+ """
249
+ pass
250
+
251
+ @abstractmethod
252
+ def isSubclassOf(self, parent: type) -> bool:
253
+ """
254
+ Checks whether the class is a subclass of the specified parent class.
255
+
256
+ Parameters
257
+ ----------
258
+ parent : type
259
+ The parent class to check against.
260
+
261
+ Returns
262
+ -------
263
+ bool
264
+ True if the class is a subclass of the parent, False otherwise.
265
+ """
266
+ pass
267
+
268
+ @abstractmethod
269
+ def isInstanceOf(self, instance: Any) -> bool:
270
+ """
271
+ Checks whether the class is an instance of the specified class.
272
+
273
+ Parameters
274
+ ----------
275
+ parent : type
276
+ The class to check against.
277
+
278
+ Returns
279
+ -------
280
+ bool
281
+ True if the class is a subclass of the parent, False otherwise.
282
+ """
283
+ pass
284
+
285
+ @abstractmethod
286
+ def isIterable(self) -> bool:
287
+ """
288
+ Checks whether the class is iterable.
289
+
290
+ Returns
291
+ -------
292
+ bool
293
+ True if the class is iterable, False otherwise.
294
+ """
295
+ pass
296
+
297
+ @abstractmethod
298
+ def isInstantiable(self) -> bool:
299
+ """
300
+ Checks whether the class can be instantiated.
301
+
302
+ Returns
303
+ -------
304
+ bool
305
+ True if the class is callable and not abstract, False otherwise.
306
+ """
307
+ pass
308
+
309
+ @abstractmethod
310
+ def newInstance(self, *args, **kwargs):
311
+ """
312
+ Creates a new instance of the class if it is instantiable.
313
+
314
+ Parameters
315
+ ----------
316
+ args : tuple
317
+ Arguments to pass to the class constructor.
318
+ kwargs : dict
319
+ Keyword arguments to pass to the class constructor.
320
+
321
+ Returns
322
+ -------
323
+ object
324
+ A new instance of the class.
325
+
326
+ Raises
327
+ ------
328
+ TypeError
329
+ If the class is not instantiable.
330
+ """
331
+ pass
332
+
333
+ @abstractmethod
334
+ def __str__(self) -> str:
335
+ """
336
+ Returns a string representation of the Reflection instance.
337
+
338
+ Returns
339
+ -------
340
+ str
341
+ A string describing the class and module.
342
+ """
343
+ pass
@@ -0,0 +1,56 @@
1
+ from abc import ABC, abstractmethod
2
+
3
+ class IStdClass(ABC):
4
+ """
5
+ An abstract base class defining the contract for any StdClass-like object.
6
+ This class ensures that any concrete implementation provides the necessary methods
7
+ for attribute management and dynamic behavior.
8
+ """
9
+
10
+ @abstractmethod
11
+ def __init__(self, **kwargs):
12
+ """
13
+ Initializes the object with optional keyword arguments to set attributes.
14
+
15
+ Parameters
16
+ ----------
17
+ kwargs : dict
18
+ Key-value pairs to set as attributes.
19
+ """
20
+ pass
21
+
22
+ @abstractmethod
23
+ def __repr__(self) -> str:
24
+ """
25
+ Returns a string representation of the object.
26
+
27
+ Returns
28
+ -------
29
+ str
30
+ A formatted string showing the object's attributes.
31
+ """
32
+ pass
33
+
34
+ @abstractmethod
35
+ def toDict(self) -> dict:
36
+ """
37
+ Converts the object's attributes to a dictionary.
38
+
39
+ Returns
40
+ -------
41
+ dict
42
+ A dictionary representation of the object's attributes.
43
+ """
44
+ pass
45
+
46
+ @abstractmethod
47
+ def update(self, **kwargs) -> None:
48
+ """
49
+ Updates the object's attributes dynamically.
50
+
51
+ Parameters
52
+ ----------
53
+ kwargs : dict
54
+ Key-value pairs to update attributes.
55
+ """
56
+ pass
File without changes
@@ -0,0 +1,81 @@
1
+ from orionis.luminate.config.environment import Environment
2
+ from orionis.luminate.contracts.facades.env_interface import IEnv
3
+
4
+ def env(key: str, default=None) -> str:
5
+ """
6
+ Retrieves the value of an environment variable from the .env file
7
+ or from system environment variables if not found.
8
+
9
+ Parameters
10
+ ----------
11
+ key : str
12
+ The key of the environment variable.
13
+ default : optional
14
+ Default value if the key does not exist. Defaults to None.
15
+
16
+ Returns
17
+ -------
18
+ str
19
+ The value of the environment variable or the default value.
20
+ """
21
+ return Environment().get(key, default)
22
+
23
+ class Env(IEnv):
24
+
25
+ @staticmethod
26
+ def get(key: str, default=None) -> str:
27
+ """
28
+ Retrieves the value of an environment variable from the .env file
29
+ or from system environment variables if not found.
30
+
31
+ Parameters
32
+ ----------
33
+ key : str
34
+ The key of the environment variable.
35
+ default : optional
36
+ Default value if the key does not exist. Defaults to None.
37
+
38
+ Returns
39
+ -------
40
+ str
41
+ The value of the environment variable or the default value.
42
+ """
43
+ Environment().get(key, default)
44
+
45
+ @staticmethod
46
+ def set(key: str, value: str) -> None:
47
+ """
48
+ Sets the value of an environment variable in the .env file.
49
+
50
+ Parameters
51
+ ----------
52
+ key : str
53
+ The key of the environment variable.
54
+ value : str
55
+ The value to set.
56
+ """
57
+ Environment().set(key, value)
58
+
59
+ @staticmethod
60
+ def unset(key: str) -> None:
61
+ """
62
+ Removes an environment variable from the .env file.
63
+
64
+ Parameters
65
+ ----------
66
+ key : str
67
+ The key of the environment variable to remove.
68
+ """
69
+ Environment().unset(key)
70
+
71
+ @staticmethod
72
+ def all() -> dict:
73
+ """
74
+ Retrieves all environment variable values from the .env file.
75
+
76
+ Returns
77
+ -------
78
+ dict
79
+ A dictionary of all environment variables and their values.
80
+ """
81
+ Environment().all()
@@ -0,0 +1,56 @@
1
+ import logging
2
+ from typing import Optional
3
+ from orionis.luminate.log.logger import Logguer
4
+ from orionis.luminate.contracts.log.logger_interface import ILogger
5
+ from orionis.luminate.contracts.facades.log_interface import ILogFacade
6
+
7
+ class Log(ILogFacade):
8
+ """
9
+ Facade for accessing the Logguer instance.
10
+
11
+ Provides a simplified interface for logging messages.
12
+ """
13
+
14
+ @staticmethod
15
+ def info(message: str) -> None:
16
+ """Logs an informational message."""
17
+ Logguer().info(message)
18
+
19
+ @staticmethod
20
+ def error(message: str) -> None:
21
+ """Logs an error message."""
22
+ Logguer().error(message)
23
+
24
+ @staticmethod
25
+ def success(message: str) -> None:
26
+ """Logs a success message (treated as info)."""
27
+ Logguer().success(message)
28
+
29
+ @staticmethod
30
+ def warning(message: str) -> None:
31
+ """Logs a warning message."""
32
+ Logguer().warning(message)
33
+
34
+ @staticmethod
35
+ def debug(message: str) -> None:
36
+ """Logs a debug message."""
37
+ Logguer().debug(message)
38
+
39
+ @staticmethod
40
+ def configure(path: Optional[str] = None, level: int = logging.INFO) -> ILogger:
41
+ """
42
+ Configures and returns the Logguer instance.
43
+
44
+ Parameters
45
+ ----------
46
+ path : str, optional
47
+ The file path where logs will be stored. If None, a default path is used.
48
+ level : int, optional
49
+ The logging level (default is logging.INFO).
50
+
51
+ Returns
52
+ -------
53
+ ILogger
54
+ Configured logger instance.
55
+ """
56
+ return Logguer(path, level)