dataenginex.plugins
DataEngineX plugin system — discovery, registration, and lifecycle.
Plugins register via entry_points(group="dataenginex.plugins") in their
pyproject.toml. At runtime, call :func:discover to find and instantiate
all installed plugins.
Example pyproject.toml::
[project.entry-points."dataenginex.plugins"]
myplugin = "mypackage.plugin:MyPlugin"
Usage::
from dataenginex.plugins import discover, PluginRegistry
registry = PluginRegistry()
for plugin in discover():
registry.register(plugin)
DataEngineXPlugin
Bases: ABC
Interface that every DataEngineX plugin must implement.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Short identifier (e.g. |
version |
str
|
SemVer string (e.g. |
Source code in src/dataenginex/plugins/registry.py
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 | |
name
abstractmethod
property
Unique plugin name.
version
abstractmethod
property
Plugin version string.
health_check()
abstractmethod
Return health status.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict with at least |
Source code in src/dataenginex/plugins/registry.py
48 49 50 51 52 53 54 | |
get_metrics()
Return plugin-specific metrics.
Override this to expose custom Prometheus-compatible metrics. Default returns an empty dict.
Source code in src/dataenginex/plugins/registry.py
56 57 58 59 60 61 62 | |
register_routes(app)
Mount plugin-specific routes onto the FastAPI app.
Override this if the plugin exposes HTTP endpoints. Default is a no-op.
Source code in src/dataenginex/plugins/registry.py
64 65 66 67 68 69 70 | |
PluginRegistry
Manages discovered plugins and provides lookup + health aggregation.
Usage::
registry = PluginRegistry()
for p in discover():
registry.register(p)
registry.get("myplugin") # single lookup
registry.all() # all registered plugins
registry.health_check_all() # aggregated health
Source code in src/dataenginex/plugins/registry.py
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 | |
count
property
Number of registered plugins.
register(plugin)
Register a plugin instance.
Raises:
| Type | Description |
|---|---|
ValueError
|
If a plugin with the same name is already registered. |
Source code in src/dataenginex/plugins/registry.py
132 133 134 135 136 137 138 139 140 141 142 | |
get(name)
Look up a plugin by name. Returns None if not found.
Source code in src/dataenginex/plugins/registry.py
144 145 146 | |
all()
Return all registered plugins in registration order.
Source code in src/dataenginex/plugins/registry.py
148 149 150 | |
health_check_all()
Run health checks across all registered plugins.
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, Any]]
|
|
Source code in src/dataenginex/plugins/registry.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
discover()
Discover and instantiate all installed DataEngineX plugins.
Scans entry_points(group="dataenginex.plugins") and calls each
entry point to get a plugin class, then instantiates it.
Returns:
| Type | Description |
|---|---|
list[DataEngineXPlugin]
|
List of plugin instances. Broken plugins are logged and skipped. |
Source code in src/dataenginex/plugins/registry.py
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 | |
get_package_version(package_name)
Return the installed version of package_name, or "0.0.0" if not found.
Source code in src/dataenginex/plugins/registry.py
15 16 17 18 19 20 | |