orionis 0.44.0__py3-none-any.whl → 0.47.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. orionis/cli_manager.py +16 -30
  2. orionis/contracts/bootstrap/i_command_bootstrapper.py +59 -0
  3. orionis/contracts/bootstrap/i_config_bootstrapper.py +112 -0
  4. orionis/contracts/bootstrap/i_environment_bootstrapper.py +33 -0
  5. orionis/{luminate/contracts/console/base/base_command_interface.py → contracts/console/base/i_command.py} +0 -1
  6. orionis/contracts/facades/config/i_config_facade.py +37 -0
  7. orionis/contracts/facades/environment/i_environment_facade.py +40 -0
  8. orionis/{luminate/contracts/facades/paths_interface.py → contracts/facades/files/i_path_facade.py} +27 -20
  9. orionis/contracts/facades/log/i_log_facade.py +83 -0
  10. orionis/{luminate/contracts/facades/tests_interface.py → contracts/facades/tests/i_tests_facade.py} +3 -6
  11. orionis/{luminate/contracts/console/scripts/management_interface.py → contracts/installer/i_installer_manager.py} +19 -16
  12. orionis/contracts/installer/i_installer_output.py +101 -0
  13. orionis/contracts/installer/i_installer_setup.py +59 -0
  14. orionis/contracts/providers/i_service_provider.py +27 -0
  15. orionis/contracts/services/config/i_config_service.py +37 -0
  16. orionis/contracts/services/files/i_path_service.py +31 -0
  17. orionis/contracts/services/log/i_log_service.py +89 -0
  18. orionis/{luminate/facades/environment.py → contracts/support/i_environment.py} +25 -32
  19. orionis/{luminate/contracts/tools/exception_to_dict_interface.py → contracts/support/i_exception_to_dict.py} +0 -9
  20. orionis/{luminate/contracts/tools/reflection_interface.py → contracts/support/i_reflection.py} +17 -8
  21. orionis/{luminate/contracts/tools/std_interface.py → contracts/support/i_std.py} +3 -16
  22. orionis/framework.py +1 -1
  23. orionis/{luminate/console/scripts/management.py → installer/installer_manager.py} +22 -16
  24. orionis/{luminate/installer/output.py → installer/installer_output.py} +16 -10
  25. orionis/{luminate/installer/setup.py → installer/installer_setup.py} +13 -25
  26. orionis/luminate/app.py +15 -11
  27. orionis/luminate/bootstrap/command_bootstrapper.py +150 -0
  28. orionis/luminate/bootstrap/config_bootstrapper.py +168 -0
  29. orionis/luminate/bootstrap/environment_bootstrapper.py +67 -0
  30. orionis/luminate/config/helpers.py +20 -0
  31. orionis/luminate/console/base/command.py +1 -3
  32. orionis/luminate/console/command_filter.py +2 -2
  33. orionis/luminate/console/commands/cache_clear.py +17 -5
  34. orionis/luminate/console/commands/help.py +19 -13
  35. orionis/luminate/console/commands/schedule_work.py +6 -3
  36. orionis/luminate/console/commands/tests.py +1 -6
  37. orionis/luminate/console/commands/version.py +0 -5
  38. orionis/luminate/console/exceptions/cli_exception.py +1 -4
  39. orionis/luminate/console/kernel.py +2 -2
  40. orionis/luminate/console/output/console.py +2 -2
  41. orionis/luminate/console/output/executor.py +1 -1
  42. orionis/luminate/console/output/progress_bar.py +1 -1
  43. orionis/luminate/console/parser.py +2 -2
  44. orionis/luminate/console/runner.py +127 -126
  45. orionis/luminate/console/tasks/scheduler.py +8 -7
  46. orionis/luminate/container/container.py +1 -1
  47. orionis/luminate/container/types.py +38 -12
  48. orionis/luminate/facades/config/config_facade.py +43 -0
  49. orionis/luminate/facades/environment/environment_facade.py +68 -0
  50. orionis/luminate/facades/{paths.py → files/path_facade.py} +50 -6
  51. orionis/luminate/facades/log/__init__.py +0 -0
  52. orionis/luminate/facades/log/log_facade.py +95 -0
  53. orionis/luminate/facades/tests/__init__.py +0 -0
  54. orionis/luminate/facades/{tests.py → tests/tests_facade.py} +1 -1
  55. orionis/luminate/patterns/__init__.py +0 -0
  56. orionis/luminate/pipelines/cli_pipeline.py +122 -116
  57. orionis/luminate/providers/__init__.py +0 -0
  58. orionis/luminate/providers/config/__init__.py +0 -0
  59. orionis/luminate/providers/config/config_service_provider.py +26 -0
  60. orionis/luminate/providers/files/__init__.py +0 -0
  61. orionis/luminate/providers/files/path_service_provider.py +26 -0
  62. orionis/luminate/providers/log/__init__.py +0 -0
  63. orionis/luminate/providers/log/log_service_provider.py +26 -0
  64. orionis/luminate/services/__init__.py +0 -0
  65. orionis/luminate/services/config/__init__.py +0 -0
  66. orionis/luminate/services/config/config_service.py +72 -0
  67. orionis/luminate/services/files/__init__.py +0 -0
  68. orionis/luminate/services/files/path_service.py +71 -0
  69. orionis/luminate/services/log/__init__.py +0 -0
  70. orionis/luminate/services/log/log_service.py +159 -0
  71. orionis/luminate/{config → support}/environment.py +21 -32
  72. orionis/luminate/{tools → support}/exception_to_dict.py +1 -1
  73. orionis/luminate/{tools → support}/reflection.py +1 -1
  74. orionis/luminate/{tools → support}/std.py +1 -1
  75. orionis/luminate/test/unit_test.py +1 -2
  76. {orionis-0.44.0.dist-info → orionis-0.47.0.dist-info}/METADATA +1 -1
  77. orionis-0.47.0.dist-info/RECORD +157 -0
  78. tests/tools/test_reflection.py +1 -1
  79. orionis/luminate/bootstrap/commands/bootstrapper.py +0 -101
  80. orionis/luminate/bootstrap/commands/register.py +0 -92
  81. orionis/luminate/bootstrap/config/bootstrapper.py +0 -79
  82. orionis/luminate/bootstrap/config/parser.py +0 -53
  83. orionis/luminate/bootstrap/config/register.py +0 -76
  84. orionis/luminate/cache/app/config.py +0 -91
  85. orionis/luminate/cache/console/commands.py +0 -97
  86. orionis/luminate/console/cache.py +0 -87
  87. orionis/luminate/console/command.py +0 -40
  88. orionis/luminate/contracts/bootstrap/commands/bootstrapper_interface.py +0 -44
  89. orionis/luminate/contracts/bootstrap/commands/register_interface.py +0 -33
  90. orionis/luminate/contracts/bootstrap/config/bootstrapper_interface.py +0 -40
  91. orionis/luminate/contracts/bootstrap/config/parser_interface.py +0 -46
  92. orionis/luminate/contracts/bootstrap/config/register_interface.py +0 -47
  93. orionis/luminate/contracts/cache/app/config_interface.py +0 -76
  94. orionis/luminate/contracts/cache/console/commands_interface.py +0 -78
  95. orionis/luminate/contracts/config/environment_interface.py +0 -64
  96. orionis/luminate/contracts/console/command_interface.py +0 -36
  97. orionis/luminate/contracts/console/runner_interface.py +0 -50
  98. orionis/luminate/contracts/facades/env_interface.py +0 -64
  99. orionis/luminate/contracts/facades/log_interface.py +0 -48
  100. orionis/luminate/contracts/files/paths_interface.py +0 -29
  101. orionis/luminate/contracts/installer/output_interface.py +0 -125
  102. orionis/luminate/contracts/installer/setup_interface.py +0 -29
  103. orionis/luminate/contracts/installer/upgrade_interface.py +0 -24
  104. orionis/luminate/contracts/log/logger_interface.py +0 -33
  105. orionis/luminate/contracts/pipelines/cli_pipeline_interface.py +0 -84
  106. orionis/luminate/contracts/publisher/pypi_publisher_interface.py +0 -36
  107. orionis/luminate/contracts/test/unit_test_interface.py +0 -51
  108. orionis/luminate/facades/config.py +0 -10
  109. orionis/luminate/facades/log.py +0 -56
  110. orionis/luminate/files/paths.py +0 -56
  111. orionis/luminate/installer/upgrade.py +0 -42
  112. orionis/luminate/log/logger.py +0 -116
  113. orionis/luminate/publisher/pypi.py +0 -215
  114. orionis-0.44.0.dist-info/RECORD +0 -156
  115. /orionis/{luminate/bootstrap/config → contracts}/__init__.py +0 -0
  116. /orionis/{luminate/cache → contracts/config}/__init__.py +0 -0
  117. /orionis/{luminate/contracts/config/config_interface.py → contracts/config/i_config.py} +0 -0
  118. /orionis/{luminate/cache/app → contracts/console}/__init__.py +0 -0
  119. /orionis/{luminate/cache/console → contracts/console/base}/__init__.py +0 -0
  120. /orionis/{luminate/contracts/console/command_filter_interface.py → contracts/console/i_command_filter.py} +0 -0
  121. /orionis/{luminate/contracts/console/kernel_interface.py → contracts/console/i_kernel.py} +0 -0
  122. /orionis/{luminate/contracts/console/parser_interface.py → contracts/console/i_parser.py} +0 -0
  123. /orionis/{luminate/contracts/console/task_manager_interface.py → contracts/console/i_task_manager.py} +0 -0
  124. /orionis/{luminate/config/dataclass → contracts/console/output}/__init__.py +0 -0
  125. /orionis/{luminate/contracts/console/output/console_interface.py → contracts/console/output/i_console.py} +0 -0
  126. /orionis/{luminate/contracts/console/output/executor_interface.py → contracts/console/output/i_executor.py} +0 -0
  127. /orionis/{luminate/contracts/console/output/progress_bar_interface.py → contracts/console/output/i_progress_bar.py} +0 -0
  128. /orionis/{luminate/console/scripts → contracts/console/tasks}/__init__.py +0 -0
  129. /orionis/{luminate/contracts/console/tasks/schedule_interface.py → contracts/console/tasks/i_schedule.py} +0 -0
  130. /orionis/{luminate/contracts/container/container_interface.py → contracts/container/i_container.py} +0 -0
  131. /orionis/{luminate/contracts/container/types_interface.py → contracts/container/i_types.py} +0 -0
  132. /orionis/{luminate/contracts → contracts/facades}/__init__.py +0 -0
  133. /orionis/{luminate/contracts/cache → contracts/facades/config}/__init__.py +0 -0
  134. /orionis/{luminate/contracts/config → contracts/facades/environment}/__init__.py +0 -0
  135. /orionis/{luminate/contracts/console → contracts/facades/files}/__init__.py +0 -0
  136. /orionis/{luminate/contracts/facades → contracts/facades/log}/__init__.py +0 -0
  137. /orionis/{luminate/contracts/files → contracts/facades/tests}/__init__.py +0 -0
  138. /orionis/{luminate/contracts → contracts}/installer/__init__.py +0 -0
  139. /orionis/{luminate/contracts/log → contracts/providers}/__init__.py +0 -0
  140. /orionis/{luminate/contracts/publisher → contracts/services}/__init__.py +0 -0
  141. /orionis/{luminate/contracts/test → contracts/services/config}/__init__.py +0 -0
  142. /orionis/{luminate/contracts/tools → contracts/services/files}/__init__.py +0 -0
  143. /orionis/{luminate/files → contracts/services/log}/__init__.py +0 -0
  144. /orionis/{luminate/installer → installer}/__init__.py +0 -0
  145. /orionis/luminate/bootstrap/{cli_exception.py → exception_bootstrapper.py} +0 -0
  146. /orionis/luminate/config/{dataclass/app.py → app.py} +0 -0
  147. /orionis/luminate/config/{dataclass/auth.py → auth.py} +0 -0
  148. /orionis/luminate/config/{dataclass/cache.py → cache.py} +0 -0
  149. /orionis/luminate/config/{dataclass/cors.py → cors.py} +0 -0
  150. /orionis/luminate/config/{dataclass/database.py → database.py} +0 -0
  151. /orionis/luminate/config/{dataclass/filesystems.py → filesystems.py} +0 -0
  152. /orionis/luminate/config/{dataclass/logging.py → logging.py} +0 -0
  153. /orionis/luminate/config/{dataclass/mail.py → mail.py} +0 -0
  154. /orionis/luminate/config/{dataclass/queue.py → queue.py} +0 -0
  155. /orionis/luminate/config/{dataclass/session.py → session.py} +0 -0
  156. /orionis/luminate/{log → facades/config}/__init__.py +0 -0
  157. /orionis/luminate/{publisher → facades/environment}/__init__.py +0 -0
  158. /orionis/luminate/{tools → facades/files}/__init__.py +0 -0
  159. /orionis/luminate/{tools → support}/dot_dict.py +0 -0
  160. /orionis/{luminate/installer → static/ascii}/icon.ascii +0 -0
  161. /orionis/{luminate/installer → static/ascii}/info.ascii +0 -0
  162. /orionis/{luminate/static → static}/bg/galaxy.jpg +0 -0
  163. /orionis/{luminate/static → static}/favicon/OrionisFrameworkFavicon.png +0 -0
  164. /orionis/{luminate/static → static}/logos/OrionisFramework.jpg +0 -0
  165. /orionis/{luminate/static → static}/logos/OrionisFramework.png +0 -0
  166. /orionis/{luminate/static → static}/logos/OrionisFramework.psd +0 -0
  167. /orionis/{luminate/static → static}/logos/OrionisFramework2.png +0 -0
  168. /orionis/{luminate/static → static}/logos/OrionisFramework3.png +0 -0
  169. {orionis-0.44.0.dist-info → orionis-0.47.0.dist-info}/LICENCE +0 -0
  170. {orionis-0.44.0.dist-info → orionis-0.47.0.dist-info}/WHEEL +0 -0
  171. {orionis-0.44.0.dist-info → orionis-0.47.0.dist-info}/entry_points.txt +0 -0
  172. {orionis-0.44.0.dist-info → orionis-0.47.0.dist-info}/top_level.txt +0 -0
@@ -1,40 +0,0 @@
1
- from typing import Any
2
- from orionis.luminate.console.runner import CLIRunner
3
- from orionis.luminate.contracts.console.command_interface import ICommand
4
-
5
- class Command(ICommand):
6
- """
7
- Command class for managing and executing registered CLI commands.
8
-
9
- This class provides a static method to invoke commands registered in the
10
- `CacheCommands` singleton, passing the required signature and any additional
11
- parameters.
12
-
13
- Methods
14
- -------
15
- call(signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any) -> Any
16
- Executes the specified command with the provided arguments.
17
- """
18
-
19
- @staticmethod
20
- def call(signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any) -> Any:
21
- """
22
- Calls a registered command using the `CLIRunner`.
23
-
24
- Parameters
25
- ----------
26
- signature : str
27
- The command signature (name) to execute.
28
- vars : dict[str, Any], optional
29
- A dictionary containing named arguments for the command (default is `{}`).
30
- *args : Any
31
- Additional positional arguments.
32
- **kwargs : Any
33
- Additional keyword arguments.
34
-
35
- Returns
36
- -------
37
- Any
38
- The output of the executed command.
39
- """
40
- return CLIRunner.handle(signature, vars, *args, **kwargs)
@@ -1,44 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- class IBootstrapper(ABC):
4
- """
5
- Manages the automatic loading and registration of command classes
6
- from Python files located in predefined directories.
7
-
8
- The `Bootstrapper` class scans specific directories for Python files, dynamically
9
- imports them, and registers classes that inherit from `BaseCommand`.
10
-
11
- Attributes
12
- ----------
13
- register : Register
14
- An instance of the `Register` class used to register command classes.
15
-
16
- Methods
17
- -------
18
- __init__(register: Register) -> None
19
- Initializes the `Bootstrapper` with a `Register` instance and triggers autoloading.
20
- _autoload() -> None
21
- Scans predefined directories for Python files, dynamically imports modules,
22
- and registers classes that extend `BaseCommand`.
23
- """
24
-
25
- @abstractmethod
26
- def _autoload(self) -> None:
27
- """
28
- Autoloads command modules from specified directories and registers command classes.
29
-
30
- This method searches for Python files in the predefined command directories,
31
- dynamically imports the modules, and registers classes that inherit from `BaseCommand`.
32
-
33
- The command directories searched are:
34
- - `app/console/commands` relative to the current working directory.
35
- - `console/commands` relative to the parent directory of the current file.
36
-
37
- It skips `__init__.py` files and ignores directories that do not exist.
38
-
39
- Raises
40
- ------
41
- BootstrapRuntimeError
42
- If an error occurs while loading a module.
43
- """
44
- pass
@@ -1,33 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Any, Callable
3
-
4
- class IRegister(ABC):
5
- """
6
- Interface for a command register.
7
- """
8
-
9
- @abstractmethod
10
- def command(self, command_class: Callable[..., Any]) -> None:
11
- """
12
- Registers a command class after validating its structure.
13
-
14
- Parameters
15
- ----------
16
- command_class : type
17
- The command class to register.
18
-
19
- Returns
20
- -------
21
- type
22
- The registered command class.
23
-
24
- Raises
25
- ------
26
- ValueError
27
- If 'signature' is missing, invalid, contains spaces, or is not a string.
28
- If 'description' is missing or not a string.
29
- If 'handle' method is missing.
30
- TypeError
31
- If the class does not inherit from 'BaseCommand'.
32
- """
33
- pass
@@ -1,40 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- class IBootstrapper(ABC):
4
- """
5
- Interface for managing the automatic loading and registration of configuration
6
- classes from Python files located in a specified directory.
7
-
8
- The `IBootstrapper` interface defines methods for scanning directories for
9
- Python files and dynamically importing them to find configuration classes.
10
- Implementations of this interface should provide the logic for registering
11
- the found classes using a `Register` instance.
12
-
13
- Methods
14
- -------
15
- autoload(directory: str) -> None
16
- Scans a directory for Python files, imports them, finds configuration classes,
17
- and registers them using the `Register` instance.
18
- """
19
-
20
- @abstractmethod
21
- def _autoload(self, directory: str) -> None:
22
- """
23
- Automatically registers configuration classes found in a given directory.
24
-
25
- This method walks through the specified directory, imports all Python files,
26
- and scans for class definitions. If a class is found, it is registered using
27
- the `Register` instance. Only classes defined in Python files (excluding
28
- `__init__.py`) are considered.
29
-
30
- Parameters
31
- ----------
32
- directory : str
33
- The directory to scan for Python configuration files.
34
-
35
- Raises
36
- ------
37
- FileNotFoundError
38
- If the provided directory does not exist.
39
- """
40
- pass
@@ -1,46 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Any
3
-
4
- class IParser(ABC):
5
- """
6
- A class responsible for parsing an instance's configuration and outputting it as a dictionary.
7
-
8
- This class uses Python's `dataclasses.asdict()` method to convert an instance's `config` attribute to a dictionary.
9
-
10
- Methods
11
- -------
12
- parse(instance: Any) -> dict
13
- Takes an instance with a `config` attribute and returns its dictionary representation.
14
-
15
- Notes
16
- -----
17
- - This method expects the instance to have a `config` attribute that is a dataclass or any object that supports `asdict()`.
18
- - The `asdict()` function will recursively convert dataclass fields into a dictionary format.
19
- - If `instance.config` is not a dataclass, this could raise an exception depending on the type.
20
- """
21
-
22
- @abstractmethod
23
- def toDict(self, instance: Any) -> dict:
24
- """
25
- Converts the `config` attribute of the provided instance to a dictionary and returns it.
26
-
27
- Parameters
28
- ----------
29
- instance : Any
30
- The instance to parse. It is expected that the instance has a `config` attribute
31
- that is a dataclass or any object that supports `asdict()`.
32
-
33
- Returns
34
- -------
35
- dict
36
- The dictionary representation of the `config` attribute.
37
-
38
- Raises
39
- ------
40
- AttributeError
41
- If the `instance` does not have a `config` attribute.
42
- TypeError
43
- If the `instance.config` is not a valid dataclass or object that supports `asdict()`.
44
- """
45
- pass
46
-
@@ -1,47 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- class IRegister(ABC):
4
- """
5
- Handles the registration of configuration classes within the application.
6
-
7
- This class ensures that only valid configuration classes are registered
8
- while enforcing structure and type safety.
9
-
10
- Attributes
11
- ----------
12
- cache_config : CacheConfig
13
- An instance of `CacheConfig` used to store registered configurations.
14
-
15
- Methods
16
- -------
17
- config(config_class: type) -> None
18
- Registers a configuration class and ensures it meets the necessary criteria.
19
- """
20
-
21
- @abstractmethod
22
- def config(self, config_class: type) -> None:
23
- """
24
- Registers a configuration class and ensures it meets the required structure.
25
-
26
- This method performs multiple validation steps, including checking if the input
27
- is a class, verifying the existence of a `config` attribute, and confirming
28
- inheritance from `IConfig`.
29
-
30
- Parameters
31
- ----------
32
- config_class : type
33
- The class to be registered as a configuration.
34
-
35
- Returns
36
- -------
37
- type
38
- The same class passed as an argument, if registration is successful.
39
-
40
- Raises
41
- ------
42
- TypeError
43
- If `config_class` is not a class or does not inherit from `IConfig`.
44
- ValueError
45
- If `config_class` does not have a `config` attribute or is already registered.
46
- """
47
- pass
@@ -1,76 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Dict, Any
3
-
4
- class ICacheConfig(ABC):
5
- """
6
- CacheConfig is a class that manages the registration, unregistration, and retrieval of configuration sections.
7
-
8
- Methods
9
- -------
10
- __init__()
11
- Initializes a new instance of the class with an empty configuration dictionary.
12
- register(section: str, data: Dict[str, Any])
13
- Registers a configuration section with its associated data.
14
- unregister(section: str)
15
- Unregisters a previously registered configuration section.
16
- get(section: str)
17
- Retrieves the configuration data for a specific section.
18
- """
19
-
20
- @abstractmethod
21
- def register(self, section: str, data: Dict[str, Any]) -> None:
22
- """
23
- Registers a configuration section.
24
-
25
- Parameters
26
- ----------
27
- section : str
28
- The name of the configuration section to register.
29
- data : dict
30
- The configuration data associated with the section.
31
-
32
- Raises
33
- ------
34
- ValueError
35
- If the section is already registered.
36
- """
37
- pass
38
-
39
- @abstractmethod
40
- def unregister(self, section: str) -> None:
41
- """
42
- Unregisters a previously registered configuration section.
43
-
44
- Parameters
45
- ----------
46
- section : str
47
- The name of the configuration section to remove.
48
-
49
- Raises
50
- ------
51
- KeyError
52
- If the section is not found in the registered configurations.
53
- """
54
- pass
55
-
56
- @abstractmethod
57
- def get(self, section: str) -> Dict[str, Any]:
58
- """
59
- Retrieves the configuration for a specific section.
60
-
61
- Parameters
62
- ----------
63
- section : str
64
- The name of the configuration section to retrieve.
65
-
66
- Returns
67
- -------
68
- dict
69
- The configuration data for the specified section.
70
-
71
- Raises
72
- ------
73
- KeyError
74
- If the requested section is not found.
75
- """
76
- pass
@@ -1,78 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Any, Callable
3
-
4
- class ICacheCommands(ABC):
5
- """
6
- CacheCommands is a class that manages the registration, unregistration, and retrieval of command instances.
7
-
8
- Methods
9
- -------
10
- __init__()
11
- Initializes the command cache with an empty dictionary.
12
- register(signature: str, description: str, arguments: list, concrete: Callable[..., Any])
13
- Register a new command with its signature, description, and class instance.
14
- unregister(signature: str)
15
- Unregister an existing command by its signature.
16
- get(signature: str)
17
- Retrieve the information of a registered command by its signature.
18
- """
19
-
20
- @abstractmethod
21
- def register(self, signature: str, description: str, arguments: list, concrete: Callable[..., Any]):
22
- """
23
- Register a new command with its signature, description, and class instance.
24
-
25
- Parameters
26
- ----------
27
- signature : str
28
- The unique identifier (signature) for the command.
29
- description : str
30
- A brief description of what the command does.
31
- concrete : class
32
- The class or callable instance that defines the command behavior.
33
-
34
- Raises
35
- ------
36
- ValueError
37
- If a command with the given signature already exists.
38
- """
39
- pass
40
-
41
- @abstractmethod
42
- def unregister(self, signature: str):
43
- """
44
- Unregister an existing command by its signature.
45
-
46
- Parameters
47
- ----------
48
- signature : str
49
- The unique identifier (signature) for the command to unregister.
50
-
51
- Raises
52
- ------
53
- KeyError
54
- If the command with the given signature does not exist.
55
- """
56
- pass
57
-
58
- @abstractmethod
59
- def get(self, signature: str):
60
- """
61
- Retrieve the information of a registered command by its signature.
62
-
63
- Parameters
64
- ----------
65
- signature : str
66
- The unique identifier (signature) for the command.
67
-
68
- Returns
69
- -------
70
- dict
71
- A dictionary containing the class, signature, and description of the command.
72
-
73
- Raises
74
- ------
75
- KeyError
76
- If the command with the given signature does not exist.
77
- """
78
- pass
@@ -1,64 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Optional, Dict
3
-
4
- class IEnvironment(ABC):
5
- """
6
- Interface for managing environment variables from a .env file.
7
- """
8
-
9
- @abstractmethod
10
- def get(self, key: str, default: Optional[str] = None) -> Optional[str]:
11
- """
12
- Retrieve the value of an environment variable.
13
-
14
- Parameters
15
- ----------
16
- key : str
17
- The key of the environment variable.
18
- default : Optional[str], optional
19
- Default value if the key does not exist, by default None.
20
-
21
- Returns
22
- -------
23
- Optional[str]
24
- The value of the environment variable or the default value.
25
- """
26
- pass
27
-
28
- @abstractmethod
29
- def set(self, key: str, value: str) -> None:
30
- """
31
- Set the value of an environment variable in the .env file.
32
-
33
- Parameters
34
- ----------
35
- key : str
36
- The key of the environment variable.
37
- value : str
38
- The value to set.
39
- """
40
- pass
41
-
42
- @abstractmethod
43
- def unset(self, key: str) -> None:
44
- """
45
- Remove an environment variable from the .env file.
46
-
47
- Parameters
48
- ----------
49
- key : str
50
- The key of the environment variable to remove.
51
- """
52
- pass
53
-
54
- @abstractmethod
55
- def all(self) -> Dict[str, str]:
56
- """
57
- Retrieve all environment variable values from the .env file.
58
-
59
- Returns
60
- -------
61
- Dict[str, str]
62
- A dictionary of all environment variables and their values.
63
- """
64
- pass
@@ -1,36 +0,0 @@
1
- from typing import Any
2
- from abc import ABC, abstractmethod
3
-
4
- class ICommand(ABC):
5
- """
6
- Interface for managing and executing registered commands.
7
-
8
- This interface ensures that any class implementing it will provide a method
9
- for executing commands from a cache by their signature.
10
- """
11
-
12
- @abstractmethod
13
- def call(signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any) -> Any:
14
- """
15
- Calls a registered command from the CacheCommands singleton.
16
-
17
- This method retrieves the command class associated with the given
18
- signature, instantiates it, and executes the `handle` method of
19
- the command instance.
20
-
21
- Parameters
22
- ----------
23
- signature : str
24
- The unique identifier (signature) of the command to be executed.
25
- **kwargs : dict
26
- Additional keyword arguments to be passed to the command instance
27
- when it is created.
28
-
29
- Raises
30
- ------
31
- KeyError
32
- If no command with the given signature is found in the cache.
33
- RuntimeError
34
- If an error occurs while executing the command.
35
- """
36
- pass
@@ -1,50 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Any
3
-
4
- class ICLIRunner(ABC):
5
- """
6
- Interface for CLIRunner, defining the structure for handling CLI command execution.
7
-
8
- This interface ensures that any implementing class properly processes and executes CLI commands.
9
-
10
- Methods
11
- -------
12
- handle(signature: str = None, vars: dict = {}, *args, **kwargs) -> Any
13
- Processes and executes a CLI command based on provided arguments.
14
- """
15
-
16
- @abstractmethod
17
- def handle(self, signature: str = None, vars: dict = {}, *args, **kwargs) -> Any:
18
- """
19
- Processes and executes a CLI command.
20
-
21
- This method:
22
- - Determines whether the command is invoked from `sys.argv` or as a function.
23
- - Extracts the command signature and arguments.
24
- - Executes the command pipeline.
25
- - Logs execution status and handles errors.
26
-
27
- Parameters
28
- ----------
29
- signature : str, optional
30
- The command signature (default is None, meaning it is extracted from `sys.argv`).
31
- vars : dict, optional
32
- Named arguments for the command (default is an empty dictionary).
33
- *args
34
- Additional arguments for the command.
35
- **kwargs
36
- Additional keyword arguments for the command.
37
-
38
- Returns
39
- -------
40
- Any
41
- The output of the executed command.
42
-
43
- Raises
44
- ------
45
- ValueError
46
- If no command signature is provided.
47
- Exception
48
- If an unexpected error occurs during execution.
49
- """
50
- pass
@@ -1,64 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Optional, Dict
3
-
4
- class IEnv(ABC):
5
- """
6
- Interface for managing environment variables from a .env file.
7
- """
8
-
9
- @abstractmethod
10
- def get(self, key: str, default: Optional[str] = None) -> Optional[str]:
11
- """
12
- Retrieve the value of an environment variable.
13
-
14
- Parameters
15
- ----------
16
- key : str
17
- The key of the environment variable.
18
- default : Optional[str], optional
19
- Default value if the key does not exist, by default None.
20
-
21
- Returns
22
- -------
23
- Optional[str]
24
- The value of the environment variable or the default value.
25
- """
26
- pass
27
-
28
- @abstractmethod
29
- def set(self, key: str, value: str) -> None:
30
- """
31
- Set the value of an environment variable in the .env file.
32
-
33
- Parameters
34
- ----------
35
- key : str
36
- The key of the environment variable.
37
- value : str
38
- The value to set.
39
- """
40
- pass
41
-
42
- @abstractmethod
43
- def unset(self, key: str) -> None:
44
- """
45
- Remove an environment variable from the .env file.
46
-
47
- Parameters
48
- ----------
49
- key : str
50
- The key of the environment variable to remove.
51
- """
52
- pass
53
-
54
- @abstractmethod
55
- def all(self) -> Dict[str, str]:
56
- """
57
- Retrieve all environment variable values from the .env file.
58
-
59
- Returns
60
- -------
61
- Dict[str, str]
62
- A dictionary of all environment variables and their values.
63
- """
64
- pass
@@ -1,48 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Optional
3
- import logging
4
- from orionis.luminate.contracts.log.logger_interface import ILogger
5
-
6
- class ILogFacade(ABC):
7
- """
8
- Facade interface for simplified access to logging operations.
9
-
10
- Methods
11
- -------
12
- info(message: str) -> None
13
- Logs an informational message.
14
- error(message: str) -> None
15
- Logs an error message.
16
- success(message: str) -> None
17
- Logs a success message (treated as info).
18
- warning(message: str) -> None
19
- Logs a warning message.
20
- debug(message: str) -> None
21
- Logs a debug message.
22
- configure(path: Optional[str], level: int) -> ILogger
23
- Configures and returns the logger instance.
24
- """
25
-
26
- @abstractmethod
27
- def info(self, message: str) -> None:
28
- pass
29
-
30
- @abstractmethod
31
- def error(self, message: str) -> None:
32
- pass
33
-
34
- @abstractmethod
35
- def success(self, message: str) -> None:
36
- pass
37
-
38
- @abstractmethod
39
- def warning(self, message: str) -> None:
40
- pass
41
-
42
- @abstractmethod
43
- def debug(self, message: str) -> None:
44
- pass
45
-
46
- @abstractmethod
47
- def configure(self, path: Optional[str] = None, level: int = logging.INFO) -> ILogger:
48
- pass