API Reference
This section contains automatic API documentation for Automax.
Plugin System
automax.plugins.base
Base classes and interfaces for Automax plugins.
This module defines the abstract base class and metadata structure that all plugins must implement.
BasePlugin
Bases: ABC
Abstract base class defining the plugin interface.
All Automax plugins must inherit from this class and implement the required abstract methods.
Source code in src/automax/plugins/base.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
__init__(config)
Initialize plugin with configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Dict[str, Any]
|
Plugin configuration dictionary |
required |
Raises:
| Type | Description |
|---|---|
PluginConfigurationError
|
If required configuration is missing |
Source code in src/automax/plugins/base.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
cleanup()
Release resources and perform cleanup operations.
Source code in src/automax/plugins/base.py
131 132 133 134 135 | |
execute()
abstractmethod
Execute the plugin's main functionality.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dictionary containing execution results |
Source code in src/automax/plugins/base.py
110 111 112 113 114 115 116 117 118 119 | |
get_example_config()
Generate example configuration for the plugin.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Example configuration dictionary |
Source code in src/automax/plugins/base.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
get_help()
Get usage documentation for the plugin.
Returns:
| Type | Description |
|---|---|
str
|
Help text describing plugin usage and configuration |
Source code in src/automax/plugins/base.py
137 138 139 140 141 142 143 144 145 | |
validate()
Validate plugin readiness before execution.
Returns:
| Type | Description |
|---|---|
bool
|
True if plugin is ready for execution |
Source code in src/automax/plugins/base.py
121 122 123 124 125 126 127 128 129 | |
PluginMetadata
Standardized metadata for plugin registration and discovery.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Unique identifier for the plugin |
|
version |
Semantic version of the plugin |
|
description |
Brief description of plugin functionality |
|
author |
Plugin author or maintainer |
|
category |
Functional category for grouping |
|
tags |
Keywords for search and filtering |
|
required_config |
List of required configuration keys |
|
optional_config |
List of optional configuration keys |
Source code in src/automax/plugins/base.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
automax.plugins.exceptions
Custom exception hierarchy for plugin error handling.
This module defines standardized exceptions for plugin configuration, execution, and validation errors.
PluginConfigurationError
Bases: PluginError
Raised when plugin configuration is invalid or incomplete.
Source code in src/automax/plugins/exceptions.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
__str__()
String representation with configuration details.
Source code in src/automax/plugins/exceptions.py
79 80 81 82 83 84 85 86 87 88 89 90 91 | |
PluginError
Bases: Exception
Base exception for all plugin-related errors.
Source code in src/automax/plugins/exceptions.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
__str__()
String representation of the error.
Source code in src/automax/plugins/exceptions.py
32 33 34 35 36 37 38 39 | |
to_dict()
Convert error to dictionary for serialization.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dictionary containing error details |
Source code in src/automax/plugins/exceptions.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
PluginExecutionError
Bases: PluginError
Raised when plugin execution fails.
Source code in src/automax/plugins/exceptions.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
__str__()
String representation with execution context.
Source code in src/automax/plugins/exceptions.py
110 111 112 113 114 115 116 117 | |
PluginSecurityError
Bases: PluginError
Raised when security constraints are violated.
Source code in src/automax/plugins/exceptions.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
__str__()
String representation with security context.
Source code in src/automax/plugins/exceptions.py
163 164 165 166 167 168 169 170 171 172 173 | |
PluginValidationError
Bases: PluginError
Raised when plugin validation fails.
Source code in src/automax/plugins/exceptions.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
__str__()
String representation with validation details.
Source code in src/automax/plugins/exceptions.py
136 137 138 139 140 141 142 143 144 | |
handle_plugin_errors(plugin_name)
Decorator for automatic plugin error handling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugin_name
|
str
|
Name of the plugin for error context |
required |
Returns:
| Type | Description |
|---|---|
Callable[[F], F]
|
Decorated function with error handling |
Source code in src/automax/plugins/exceptions.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
automax.plugins.registry
Plugin registry for dynamic discovery and management.
This module provides centralized plugin registration, discovery, and metadata management.
PluginRegistry
Central registry for plugin registration and discovery.
Source code in src/automax/plugins/registry.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
get_metadata(name)
Retrieve plugin metadata by name.
Source code in src/automax/plugins/registry.py
67 68 69 70 71 72 73 | |
get_plugin_class(name)
Retrieve plugin class by name.
Source code in src/automax/plugins/registry.py
59 60 61 62 63 64 65 | |
get_plugins_by_tag(tag)
Find plugins by tag.
Source code in src/automax/plugins/registry.py
87 88 89 90 91 92 93 | |
list_plugins(category=None)
List all registered plugins.
Source code in src/automax/plugins/registry.py
75 76 77 78 79 80 81 82 83 84 85 | |
load_all_plugins()
Discover and load all plugins from the plugins directory.
Source code in src/automax/plugins/registry.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
register(plugin_class)
Register a plugin class in the registry.
Source code in src/automax/plugins/registry.py
29 30 31 32 33 34 35 36 37 38 39 | |
register_plugin(plugin_class)
Class decorator for automatic plugin registration.
Source code in src/automax/plugins/registry.py
150 151 152 153 154 155 | |
Core Managers
automax.core.managers.plugin_manager
Plugin Manager for Automax.
This module handles plugin loading, registration, and execution.
PluginManager
Manages plugin loading and execution.
This class provides backward compatibility with the existing system while integrating with the new plugin registry.
Source code in src/automax/core/managers/plugin_manager.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
__init__(logger=None)
Initialize the PluginManager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger
|
optional
|
Logger instance for debug/info/error messages. |
None
|
Source code in src/automax/core/managers/plugin_manager.py
23 24 25 26 27 28 29 30 31 32 33 | |
execute_plugin(name, config)
Execute a plugin with given configuration.
This method first tries the new registry system, then falls back to legacy plugins for backward compatibility.
Source code in src/automax/core/managers/plugin_manager.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
get_plugin(plugin_name)
Get plugin class by name.
Source code in src/automax/core/managers/plugin_manager.py
112 113 114 115 116 | |
list_plugins()
List all available plugins.
Source code in src/automax/core/managers/plugin_manager.py
118 119 120 121 122 123 124 125 126 127 128 | |
get_plugin_manager()
Get the global plugin manager instance.
Source code in src/automax/core/managers/plugin_manager.py
135 136 137 138 139 140 141 142 | |
automax.core.managers.logger_manager
Logger manager for Automax.
Handles centralized logging to console, file, optional JSON, and error file.
AlignedFormatter
Bases: Formatter
Formatter that aligns level names and formats timestamps in ISO 8601 with local timezone.
Source code in src/automax/core/managers/logger_manager.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
JsonStreamingFormatter
Bases: Formatter
Formatter that outputs log records as JSON objects compliant with RFC 8259.
Source code in src/automax/core/managers/logger_manager.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
LoggerManager
Manager class for centralized logging.
Source code in src/automax/core/managers/logger_manager.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
__init__(log_directory=None, log_level='DEBUG', json_log=False)
Initialize LoggerManager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_directory
|
str or Path
|
Directory for log files. |
None
|
log_level
|
str
|
Logging level. |
'DEBUG'
|
json_log
|
bool
|
Enable JSON logging. |
False
|
Source code in src/automax/core/managers/logger_manager.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
debug(msg)
Log a message at DEBUG level.
Source code in src/automax/core/managers/logger_manager.py
190 191 192 193 194 195 196 197 198 199 200 | |
error(msg)
Log a message at ERROR level and write to .err file.
Source code in src/automax/core/managers/logger_manager.py
226 227 228 229 230 231 232 233 234 235 236 237 | |
fatal(msg)
Log a message at FATAL level and write to .err file.
Source code in src/automax/core/managers/logger_manager.py
239 240 241 242 243 244 245 246 247 248 249 250 | |
get_logger()
Return the internal logger instance.
Source code in src/automax/core/managers/logger_manager.py
137 138 139 140 141 | |
info(msg)
Log a message at INFO level.
Source code in src/automax/core/managers/logger_manager.py
202 203 204 205 206 207 208 209 210 211 212 | |
log(level, msg)
Log a message at the given severity level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
str
|
Logging level ('DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'). |
required |
msg
|
str
|
Message to log. |
required |
Source code in src/automax/core/managers/logger_manager.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
shutdown()
Shutdown logger: flush and close all handlers.
Source code in src/automax/core/managers/logger_manager.py
175 176 177 178 179 180 181 182 183 184 | |
warning(msg)
Log a message at WARNING level.
Source code in src/automax/core/managers/logger_manager.py
214 215 216 217 218 219 220 221 222 223 224 | |