Plugins
zenml.plugins
Modules
base_plugin_flavor
Base implementation for all Plugin Flavors.
Classes
BasePlugin
Bases: ABC
Base Class for all Plugins.
config_class: Type[BasePluginConfig]
abstractmethod
property
Returns the BasePluginConfig
config.
Returns:
Type | Description |
---|---|
Type[BasePluginConfig]
|
The configuration. |
flavor_class: Type[BasePluginFlavor]
abstractmethod
property
Returns the flavor class of the plugin.
Returns:
Type | Description |
---|---|
Type[BasePluginFlavor]
|
The flavor class of the plugin. |
zen_store: BaseZenStore
property
BasePluginConfig
Bases: BaseModel
, ABC
Allows configuring of Event Source and Filter configuration.
BasePluginFlavor
Bases: ABC
Base Class for all PluginFlavors.
get_flavor_response_model(hydrate: bool) -> BasePluginFlavorResponse[Any, Any, Any]
abstractmethod
classmethod
Convert the Flavor into a Response Model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hydrate
|
bool
|
Whether the model should be hydrated. |
required |
Source code in src/zenml/plugins/base_plugin_flavor.py
79 80 81 82 83 84 85 86 87 88 |
|
plugin_flavor_registry
Registry for all plugins.
Classes
PluginFlavorRegistry()
Registry for plugin flavors.
Initialize the event flavor registry.
Source code in src/zenml/plugins/plugin_flavor_registry.py
45 46 47 48 49 50 |
|
get_flavor_class(_type: PluginType, subtype: PluginSubType, name: str) -> Type[BasePluginFlavor]
Get a single event_source based on the key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
_type
|
PluginType
|
The type of plugin. |
required |
subtype
|
PluginSubType
|
The subtype of plugin. |
required |
name
|
str
|
Indicates the name of the plugin flavor. |
required |
Returns:
Type | Description |
---|---|
Type[BasePluginFlavor]
|
|
Raises:
Type | Description |
---|---|
KeyError
|
If there is no entry at this type, subtype, flavor |
Source code in src/zenml/plugins/plugin_flavor_registry.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
|
get_plugin(_type: PluginType, subtype: PluginSubType, name: str) -> BasePlugin
Get the plugin based on the flavor, type and subtype.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the plugin flavor. |
required |
_type
|
PluginType
|
The type of plugin. |
required |
subtype
|
PluginSubType
|
The subtype of plugin. |
required |
Returns:
Type | Description |
---|---|
BasePlugin
|
Plugin instance associated with the flavor, type and subtype. |
Raises:
Type | Description |
---|---|
KeyError
|
If no plugin is found for the given flavor, type and subtype. |
RuntimeError
|
If the plugin was not initialized. |
Source code in src/zenml/plugins/plugin_flavor_registry.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
|
initialize_plugins() -> None
Initializes all registered plugins.
Source code in src/zenml/plugins/plugin_flavor_registry.py
334 335 336 337 338 339 340 341 342 |
|
list_available_flavor_responses_for_type_and_subtype(_type: PluginType, subtype: PluginSubType, page: int, size: int, hydrate: bool = False) -> Page[BasePluginFlavorResponse[Any, Any, Any]]
Get a list of all subtypes for a specific flavor and type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
_type
|
PluginType
|
The type of Plugin |
required |
subtype
|
PluginSubType
|
The subtype of the plugin |
required |
page
|
int
|
Page for pagination (offset +1) |
required |
size
|
int
|
Page size for pagination |
required |
hydrate
|
bool
|
Whether to hydrate the response bodies |
False
|
Returns:
Type | Description |
---|---|
Page[BasePluginFlavorResponse[Any, Any, Any]]
|
A page of flavors. |
Raises:
Type | Description |
---|---|
ValueError
|
If the page is out of range. |
Source code in src/zenml/plugins/plugin_flavor_registry.py
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 |
|
list_available_flavors_for_type_and_subtype(_type: PluginType, subtype: PluginSubType) -> List[Type[BasePluginFlavor]]
Get a list of all subtypes for a specific flavor and type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
_type
|
PluginType
|
The type of Plugin |
required |
subtype
|
PluginSubType
|
The subtype of the plugin |
required |
Returns:
Type | Description |
---|---|
List[Type[BasePluginFlavor]]
|
List of flavors for the given type/subtype combination. |
Source code in src/zenml/plugins/plugin_flavor_registry.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
list_subtypes_within_type(_type: PluginType) -> List[PluginSubType]
Returns all available subtypes for a given type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
_type
|
PluginType
|
The type of plugin |
required |
Returns:
Type | Description |
---|---|
List[PluginSubType]
|
A list of available plugin subtypes for this plugin type. |
Source code in src/zenml/plugins/plugin_flavor_registry.py
61 62 63 64 65 66 67 68 69 70 71 72 |
|
register_plugin_flavor(flavor_class: Type[BasePluginFlavor]) -> None
Registers a new event_source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flavor_class
|
Type[BasePluginFlavor]
|
The flavor to register |
required |
Source code in src/zenml/plugins/plugin_flavor_registry.py
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 |
|
register_plugin_flavors() -> None
Registers all flavors.
Source code in src/zenml/plugins/plugin_flavor_registry.py
222 223 224 225 226 227 |
|
RegistryEntry
Bases: BaseModel
Registry Entry Class for the Plugin Registry.