Plugins API Reference π
Base classes and utilities for the FlowyML plugin system.
Base Plugin
flowyml.plugins.base.BasePlugin(name: str = None, **config)
Bases: ABC
Base class for all FlowyML plugins.
All plugins must inherit from this class and implement the required methods.
Initialize the plugin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Optional name override for this instance. |
None
|
**config
|
Configuration parameters for the plugin. |
{}
|
Source code in flowyml/plugins/base.py
Attributes
config: dict[str, Any]
property
Get the plugin configuration.
name: str
property
Get the plugin instance name.
plugin_type: PluginType
abstractmethod
property
Return the type of this plugin.
Functions
cleanup() -> None
Cleanup resources used by the plugin.
Override this method to close connections, flush buffers, etc.
from_dict(data: dict[str, Any]) -> BasePlugin
classmethod
Create a plugin instance from a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
Dictionary containing plugin configuration. |
required |
Returns:
| Type | Description |
|---|---|
BasePlugin
|
A new plugin instance. |
Source code in flowyml/plugins/base.py
initialize() -> None
Initialize the plugin. Called before first use.
Override this method to perform setup operations like connecting to external services.
to_dict() -> dict[str, Any]
Serialize the plugin configuration to a dictionary.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary representation of the plugin. |
Source code in flowyml/plugins/base.py
validate() -> bool
Validate that the plugin is properly configured.
Returns:
| Type | Description |
|---|---|
bool
|
True if the plugin is valid and ready to use. |
Plugin Metadata
flowyml.plugins.base.PluginMetadata(name: str, description: str, plugin_type: PluginType, version: str = '1.0.0', author: str = 'FlowyML', packages: list[str] = list(), documentation_url: str = '', tags: list[str] = list())
dataclass
Metadata for a plugin.
Plugin Type
flowyml.plugins.base.PluginType
Bases: Enum
Types of plugins available in FlowyML.
Experiment Tracker
flowyml.plugins.base.ExperimentTracker(name: str = None, **config)
Bases: BasePlugin
Base class for experiment tracking plugins.
Experiment trackers record parameters, metrics, and artifacts from ML experiments for reproducibility and comparison.
Source code in flowyml/plugins/base.py
Functions
end_run(status: str = 'FINISHED') -> None
abstractmethod
End the current run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status
|
str
|
Final status of the run (FINISHED, FAILED, etc.) |
'FINISHED'
|
get_tracking_uri() -> str
Get the tracking URI for this tracker.
Returns:
| Type | Description |
|---|---|
str
|
The tracking URI. |
log_artifact(local_path: str, artifact_path: str = None) -> None
Log an artifact (file) for the current run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
local_path
|
str
|
Path to the local file to log. |
required |
artifact_path
|
str
|
Optional path within the artifact store. |
None
|
Source code in flowyml/plugins/base.py
log_metrics(metrics: dict[str, float], step: int = None) -> None
abstractmethod
Log metrics for the current run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metrics
|
dict[str, float]
|
Dictionary of metric names and values. |
required |
step
|
int
|
Optional step number for the metrics. |
None
|
Source code in flowyml/plugins/base.py
log_model(model: Any, artifact_path: str, model_type: str = None) -> None
Log a model for the current run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Any
|
The model object to log. |
required |
artifact_path
|
str
|
Path within the artifact store. |
required |
model_type
|
str
|
Type of model (sklearn, pytorch, tensorflow, etc.) |
None
|
Source code in flowyml/plugins/base.py
log_params(params: dict[str, Any]) -> None
abstractmethod
Log parameters for the current run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
dict[str, Any]
|
Dictionary of parameter names and values. |
required |
start_run(run_name: str, experiment_name: str = None, tags: dict = None) -> str
abstractmethod
Start a new experiment run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_name
|
str
|
Name for this run. |
required |
experiment_name
|
str
|
Name of the experiment to log to. |
None
|
tags
|
dict
|
Optional tags for the run. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Run ID. |
Source code in flowyml/plugins/base.py
Artifact Store Plugin
flowyml.plugins.base.ArtifactStorePlugin(name: str = None, **config)
Bases: BasePlugin
Base class for artifact storage plugins.
Artifact stores handle the persistence of artifacts like datasets, models, and other files.
Source code in flowyml/plugins/base.py
Attributes
root_path: str
property
Get the root path of the artifact store.
Functions
delete(path: str) -> bool
Delete an artifact from the store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to delete. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if deletion was successful. |
exists(path: str) -> bool
abstractmethod
Check if an artifact exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the artifact exists. |
list(path: str = '') -> list[str]
List artifacts in a directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory path to list. |
''
|
Returns:
| Type | Description |
|---|---|
list[str]
|
List of artifact paths. |
load(path: str) -> Any
abstractmethod
Load an artifact from the store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the artifact. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The loaded artifact. |
save(artifact: Any, path: str) -> str
abstractmethod
Save an artifact to the store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
artifact
|
Any
|
The artifact to save. |
required |
path
|
str
|
Path within the store. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Full URI of the saved artifact. |
Source code in flowyml/plugins/base.py
Orchestrator Plugin
flowyml.plugins.base.OrchestratorPlugin(name: str = None, **config)
Bases: BasePlugin
Base class for orchestrator plugins.
Orchestrators manage the execution of pipeline steps, handling scheduling, resource allocation, and monitoring.
Source code in flowyml/plugins/base.py
Functions
cancel_run(run_id: str) -> bool
Cancel a running pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_id
|
str
|
The run identifier. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if cancellation was successful. |
get_run_status(run_id: str) -> str
Get the status of a pipeline run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_id
|
str
|
The run identifier. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Run status string. |
list_runs(pipeline_name: str = None, limit: int = 100) -> list[dict]
List pipeline runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline_name
|
str
|
Optional filter by pipeline name. |
None
|
limit
|
int
|
Maximum number of runs to return. |
100
|
Returns:
| Type | Description |
|---|---|
list[dict]
|
List of run dictionaries. |
Source code in flowyml/plugins/base.py
run_pipeline(pipeline: Any, run_id: str, context: dict[str, Any] = None, **kwargs) -> Any
abstractmethod
Run a pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline
|
Any
|
The pipeline to run. |
required |
run_id
|
str
|
Unique identifier for this run. |
required |
context
|
dict[str, Any]
|
Optional context dictionary. |
None
|
**kwargs
|
Additional orchestrator-specific arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
Run result or status. |
Source code in flowyml/plugins/base.py
Container Registry Plugin
flowyml.plugins.base.ContainerRegistryPlugin(name: str = None, **config)
Bases: BasePlugin
Base class for container registry plugins.
Container registries store and manage Docker images for pipeline execution.
Source code in flowyml/plugins/base.py
Attributes
registry_uri: str
property
Get the registry URI.
Functions
get_image_uri(image_name: str, tag: str = 'latest') -> str
abstractmethod
Get the full URI for an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_name
|
str
|
Name of the image. |
required |
tag
|
str
|
Image tag. |
'latest'
|
Returns:
| Type | Description |
|---|---|
str
|
Full image URI. |
pull_image(image_name: str, tag: str = 'latest') -> None
Pull an image from the registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_name
|
str
|
Name of the image. |
required |
tag
|
str
|
Image tag. |
'latest'
|
push_image(image_name: str, tag: str = 'latest') -> str
abstractmethod
Push an image to the registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_name
|
str
|
Name of the image. |
required |
tag
|
str
|
Image tag. |
'latest'
|
Returns:
| Type | Description |
|---|---|
str
|
Full image URI. |
Model Registry Plugin
flowyml.plugins.base.ModelRegistryPlugin(name: str = None, **config)
Bases: BasePlugin
Base class for model registry plugins.
Model registries track, version, and manage ML models throughout their lifecycle.
Source code in flowyml/plugins/base.py
Functions
get_model(name: str, version: str = None) -> Any
abstractmethod
Get a model by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Model name. |
required |
version
|
str
|
Optional version (defaults to latest). |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The model. |
list_models(name: str = None) -> list[dict]
List registered models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Optional filter by model name. |
None
|
Returns:
| Type | Description |
|---|---|
list[dict]
|
List of model metadata dictionaries. |
register_model(name: str, model_uri: str, version: str = None, metadata: dict = None) -> str
abstractmethod
Register a model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Model name. |
required |
model_uri
|
str
|
URI to the model artifact. |
required |
version
|
str
|
Optional version string. |
None
|
metadata
|
dict
|
Optional metadata dictionary. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Model version identifier. |
Source code in flowyml/plugins/base.py
transition_model_stage(name: str, version: str, stage: str) -> None
Transition a model to a new stage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Model name. |
required |
version
|
str
|
Model version. |
required |
stage
|
str
|
Target stage (staging, production, archived). |
required |
Source code in flowyml/plugins/base.py
Model Deployer Plugin
flowyml.plugins.base.ModelDeployerPlugin(name: str = None, **config)
Bases: BasePlugin
Base class for model deployment plugins.
Model deployers handle deploying ML models to inference endpoints for serving predictions.
Source code in flowyml/plugins/base.py
Functions
deploy(model: Any, endpoint_name: str, model_name: str = None, **config) -> str
abstractmethod
Deploy a model to an endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Any
|
The model to deploy (URI, artifact, or object). |
required |
endpoint_name
|
str
|
Name for the endpoint. |
required |
model_name
|
str
|
Optional model name in registry. |
None
|
**config
|
Deployment configuration. |
{}
|
Returns:
| Type | Description |
|---|---|
str
|
Endpoint URI or identifier. |
Source code in flowyml/plugins/base.py
get_endpoint_status(endpoint: str) -> dict[str, Any]
Get the status of an endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoint
|
str
|
Endpoint URI or identifier. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Status dictionary. |
list_endpoints() -> list[dict]
List all deployed endpoints.
Returns:
| Type | Description |
|---|---|
list[dict]
|
List of endpoint metadata dictionaries. |
predict(endpoint: str, data: Any) -> Any
abstractmethod
Make predictions using a deployed model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoint
|
str
|
Endpoint URI or identifier. |
required |
data
|
Any
|
Input data for prediction. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Prediction results. |
Source code in flowyml/plugins/base.py
undeploy(endpoint: str) -> bool
Undeploy a model endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoint
|
str
|
Endpoint URI or identifier. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if successful. |
Alerter Plugin
flowyml.plugins.base.AlerterPlugin(name: str = None, **config)
Bases: BasePlugin
Base class for alerter plugins.
Alerters send notifications about pipeline events, errors, and other important occurrences.
Source code in flowyml/plugins/base.py
Functions
send_alert(title: str, message: str, level: str = 'info', **kwargs) -> bool
abstractmethod
Send an alert notification.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Alert title. |
required |
message
|
str
|
Alert message body. |
required |
level
|
str
|
Alert level (info, warning, error, critical). |
'info'
|
**kwargs
|
Additional alerter-specific parameters. |
{}
|
Returns:
| Type | Description |
|---|---|
bool
|
True if alert was sent successfully. |
Source code in flowyml/plugins/base.py
send_error(title: str, message: str) -> bool
Feature Store Plugin
flowyml.plugins.base.FeatureStorePlugin(name: str = None, **config)
Bases: BasePlugin
Base class for feature store plugins.
Feature stores manage ML features for training and inference, providing versioning, serving, and discovery capabilities.
Source code in flowyml/plugins/base.py
Functions
get_feature_view(name: str, version: str = None) -> Any
abstractmethod
Get a feature view by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the feature view. |
required |
version
|
str
|
Optional version. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The feature view. |
Source code in flowyml/plugins/base.py
get_historical_features(feature_refs: list[str], entity_df: Any) -> Any
Get historical features for training.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature_refs
|
list[str]
|
List of feature references. |
required |
entity_df
|
Any
|
DataFrame with entity keys and timestamps. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
DataFrame with features. |
Source code in flowyml/plugins/base.py
get_online_features(feature_refs: list[str], entity_rows: list[dict]) -> dict[str, list]
abstractmethod
Get online (real-time) features.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature_refs
|
list[str]
|
List of feature references (feature_view:feature). |
required |
entity_rows
|
list[dict]
|
Entity key-value pairs. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, list]
|
Dictionary of feature names to value lists. |
Source code in flowyml/plugins/base.py
Data Validator Plugin
flowyml.plugins.base.DataValidatorPlugin(name: str = None, **config)
Bases: BasePlugin
Base class for data validation plugins.
Data validators check data quality, schema conformance, and detect anomalies in datasets.
Source code in flowyml/plugins/base.py
Functions
get_data_profile(data: Any) -> dict[str, Any]
Generate a profile of the data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any
|
The data to profile. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Data profile dictionary. |
validate(data: Any, expectations: Any = None) -> dict[str, Any]
abstractmethod
Validate data against expectations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any
|
The data to validate. |
required |
expectations
|
Any
|
Validation rules/expectations. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Validation results dictionary. |