mloda-plugins: Building mloda Plugins
Check the registry index first
Always do this before writing a plugin: it may already exist. mloda-registry publishes community plugins
covering common {col}__{op} transforms (aggregation, window/scalar/frame aggregate, scalar/point arithmetic,
rank, offset, percentile, binning, datetime, string ops, time bucketization, ffill, ema, sessionization,
resample); see its plugins table for the full list. None
of it ships with plain pip install mloda; install what you need (pip install mloda-community for all, or
one package like pip install "mloda-community-rank[pandas]"), then confirm what's actually loaded:
from mloda.user import PluginLoader
from mloda.steward import get_feature_group_docs
PluginLoader.all()
for fg in get_feature_group_docs():
print(fg.name, fg.description)
An empty or unrelated result means it isn't installed yet, not that it doesn't exist; see
02-discover-plugins.md
for more on installed-vs-available. (The mloda skill covers the same check for requesting data instead of
writing a plugin.)
The three plugin types
Reach for a ComputeFramework only when adding a new execution backend, or an Extender for cross-cutting hooks.
Minimal example
A primary-source FeatureGroup (no inputs):
from mloda.provider import FeatureGroup
class CustomerScoring(FeatureGroup):
@classmethod
def calculate_feature(cls, data, features):
return {"customer_score": 100}
A chained one, reusable via an input__operation feature name (see "FeatureGroup: key decisions" below):
from mloda.provider import FeatureChainParserMixin, FeatureGroup
class MyOp(FeatureChainParserMixin, FeatureGroup):
PREFIX_PATTERN = r".*__([\w]+)_my_op$"
PROPERTY_MAPPING = {...}
@classmethod
def calculate_feature(cls, data, features): ...
Register either via PluginLoader.all() (installed package) or a direct import; see
03-create-plugin-in-project.md.
The plugin journey
Progression from using to sharing, each guide hosted in mloda-registry:
- Use an existing plugin / Discover plugins - start here, before writing anything.
- Create a plugin in your project - add a FeatureGroup inline, no separate package.
- Create a plugin package - scaffold a standalone installable package from mloda-plugin-template.
- Share with your team (private git) / Publish to the community registry / Contribute to official plugins / Become an official plugin.
Full progression: docs/guides/index.md.
FeatureGroup: key decisions
Full decision tree: guide 09. The recurring ones:
- Loads external data (file, DB, API)? Root feature pattern, see 01-root-features.md.
- Transforms 1+ existing features? Derived feature, see 02-derived-features.md.
- Should it be reusable via an
input__operation naming pattern? FeatureChainParserMixin, see 03-chained-features.md (2+ inputs: 04-multi-input-features.md).
- Multiple output columns? 05-multi-output-features.md (
feature~0, feature~1).
- Fitted/trained state between runs? 06-artifact-features.md.
- Time ordering, group-by, or joins across feature groups? 07-index-features.md / 08-links-joins.md.
- Group-identity option vs. runtime-only metadata? 11-options.md - a required context option that isn't forwarded through
input_features() breaks chained requests; see 26-input-feature-forwarding.md for the forwarding mechanism itself.
- Standard column transform (binning, window/scalar/frame aggregate, scalar/point arithmetic, rank, offset, percentile, string op, time bucketization, ffill, ema, resample, sessionization)? See the data operation patterns index before writing one from scratch.
- Feature defined via JSON/config instead of a naming pattern (e.g. to back the
mloda skill's LLM Tool Function pattern)? 22-feature-config.md.
- Ready to test? 10-testing-guide.md.
Full pattern index (27 guides, covering filters, validators, versioning, streaming, realtime execution, and
more): feature-group-patterns/index.md.
ComputeFramework: key decisions
Full decision tree: guide 10.
Full pattern index: compute-framework-patterns/index.md.
Extender: key decisions
Full guide: guide 11. Wraps feature calculation or input/output
validation; set a custom priority (lower runs first, default 100) if execution order matters; use class-level
storage for state under ParallelizationMode.MULTIPROCESSING (must be pickle-safe).
Reference
1---
2name: mloda-plugins
3description: >
4 Guide an AI agent through building mloda (https://github.com/mloda-ai/mloda) plugins: FeatureGroup,
5 ComputeFramework, and Extender classes. Use to check the mloda-registry index for an existing plugin before
6 writing one, when writing or reviewing a FeatureGroup/ComputeFramework/Extender implementation, or when
7 packaging, sharing, or publishing a plugin to mloda-registry.
8license: MIT
9---
10
11# mloda-plugins: Building mloda Plugins
12
13## Check the registry index first
14
15Always do this before writing a plugin: it may already exist. mloda-registry publishes community plugins
16covering common `{col}__{op}` transforms (aggregation, window/scalar/frame aggregate, scalar/point arithmetic,
17rank, offset, percentile, binning, datetime, string ops, time bucketization, ffill, ema, sessionization,
18resample); see its [plugins table](https://github.com/mloda-ai/mloda-registry#plugins) for the full list. None
19of it ships with plain `pip install mloda`; install what you need (`pip install mloda-community` for all, or
20one package like `pip install "mloda-community-rank[pandas]"`), then confirm what's actually loaded:
21
22```python
23from mloda.user import PluginLoader
24from mloda.steward import get_feature_group_docs
25
26PluginLoader.all()
27for fg in get_feature_group_docs():
28 print(fg.name, fg.description)
29```
30
31An empty or unrelated result means it isn't installed yet, not that it doesn't exist; see
32[02-discover-plugins.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/02-discover-plugins.md)
33for more on installed-vs-available. (The `mloda` skill covers the same check for requesting data instead of
34writing a plugin.)
35
36## The three plugin types
37
38| Type | Role | Full guide |
39|------|------|------------|
40| **FeatureGroup** | A data transformation, the unit you'll write most often | [09-create-feature-group.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/09-create-feature-group.md) |
41| **ComputeFramework** | The execution backend a transformation runs on (Pandas, PyArrow, Polars, DuckDB, ...) | [10-create-compute-framework.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/10-create-compute-framework.md) |
42| **Extender** | Hooks for logging, tracing, validation around feature calculation | [11-create-extender.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/11-create-extender.md) |
43
44Reach for a ComputeFramework only when adding a new execution backend, or an Extender for cross-cutting hooks.
45
46## Minimal example
47
48A primary-source FeatureGroup (no inputs):
49
50```python
51from mloda.provider import FeatureGroup
52
53class CustomerScoring(FeatureGroup):
54 @classmethod
55 def calculate_feature(cls, data, features):
56 return {"customer_score": 100}
57```
58
59A chained one, reusable via an `input__operation` feature name (see "FeatureGroup: key decisions" below):
60
61```python
62from mloda.provider import FeatureChainParserMixin, FeatureGroup
63
64class MyOp(FeatureChainParserMixin, FeatureGroup):
65 PREFIX_PATTERN = r".*__([\w]+)_my_op$"
66 PROPERTY_MAPPING = {...}
67
68 @classmethod
69 def calculate_feature(cls, data, features): ...
70```
71
72Register either via `PluginLoader.all()` (installed package) or a direct import; see
73[03-create-plugin-in-project.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/03-create-plugin-in-project.md).
74
75## The plugin journey
76
77Progression from using to sharing, each guide hosted in mloda-registry:
78
791. [Use an existing plugin](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/01-use-existing-plugin.md) / [Discover plugins](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/02-discover-plugins.md) - start here, before writing anything.
802. [Create a plugin in your project](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/03-create-plugin-in-project.md) - add a FeatureGroup inline, no separate package.
813. [Create a plugin package](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/04-create-plugin-package.md) - scaffold a standalone installable package from [mloda-plugin-template](https://github.com/mloda-ai/mloda-plugin-template).
824. [Share with your team](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/05-share-with-team.md) (private git) / [Publish to the community registry](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/06-publish-to-community.md) / [Contribute to official plugins](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/07-contribute-to-official.md) / [Become an official plugin](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/08-become-official.md).
83
84Full progression: [docs/guides/index.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/index.md).
85
86## FeatureGroup: key decisions
87
88Full decision tree: [guide 09](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/09-create-feature-group.md). The recurring ones:
89
90- **Loads external data (file, DB, API)?** Root feature pattern, see [01-root-features.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/01-root-features.md).
91- **Transforms 1+ existing features?** Derived feature, see [02-derived-features.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/02-derived-features.md).
92- **Should it be reusable via an `input__operation` naming pattern?** `FeatureChainParserMixin`, see [03-chained-features.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/03-chained-features.md) (2+ inputs: [04-multi-input-features.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/04-multi-input-features.md)).
93- **Multiple output columns?** [05-multi-output-features.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/05-multi-output-features.md) (`feature~0`, `feature~1`).
94- **Fitted/trained state between runs?** [06-artifact-features.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/06-artifact-features.md).
95- **Time ordering, group-by, or joins across feature groups?** [07-index-features.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/07-index-features.md) / [08-links-joins.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/08-links-joins.md).
96- **Group-identity option vs. runtime-only metadata?** [11-options.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/11-options.md) - a required context option that isn't forwarded through `input_features()` breaks chained requests; see [26-input-feature-forwarding.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/26-input-feature-forwarding.md) for the forwarding mechanism itself.
97- **Standard column transform** (binning, window/scalar/frame aggregate, scalar/point arithmetic, rank, offset, percentile, string op, time bucketization, ffill, ema, resample, sessionization)? See the [data operation patterns index](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/data-operation-patterns/index.md) before writing one from scratch.
98- **Feature defined via JSON/config instead of a naming pattern** (e.g. to back the `mloda` skill's LLM Tool Function pattern)? [22-feature-config.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/22-feature-config.md).
99- **Ready to test?** [10-testing-guide.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/10-testing-guide.md).
100
101Full pattern index (27 guides, covering filters, validators, versioning, streaming, realtime execution, and
102more): [feature-group-patterns/index.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/feature-group-patterns/index.md).
103
104## ComputeFramework: key decisions
105
106Full decision tree: [guide 10](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/10-create-compute-framework.md).
107
108- **Needs a connection/session object?** Data lake table format (Iceberg, Delta, Hudi) -> [05-data-lake.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/05-data-lake.md); otherwise -> [03-stateful-connection.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/03-stateful-connection.md) (DuckDB, Spark).
109- **Lazy evaluation?** [02-stateless-lazy.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/02-stateless-lazy.md) (Polars Lazy, Ibis).
110- **Eager, no external deps?** [04-zero-dependency.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/04-zero-dependency.md); with deps -> [01-stateless-eager.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/01-stateless-eager.md) (Pandas, PyArrow).
111- **Cross-framework conversion?** [08-framework-transformer.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/08-framework-transformer.md).
112- **Joins/merges or filters?** [06-merge-engine.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/06-merge-engine.md) / [07-filter-engine.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/07-filter-engine.md).
113- **Ready to test?** [09-testing-guide.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/09-testing-guide.md).
114
115Full pattern index: [compute-framework-patterns/index.md](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/compute-framework-patterns/index.md).
116
117## Extender: key decisions
118
119Full guide: [guide 11](https://github.com/mloda-ai/mloda-registry/blob/main/docs/guides/11-create-extender.md). Wraps feature calculation or input/output
120validation; set a custom priority (lower runs first, default 100) if execution order matters; use class-level
121storage for state under `ParallelizationMode.MULTIPROCESSING` (must be pickle-safe).
122
123## Reference
124
125- Registry (community/enterprise plugins, guides): <https://github.com/mloda-ai/mloda-registry>
126- Plugin template (scaffold for a standalone package): <https://github.com/mloda-ai/mloda-plugin-template>
127- Core docs: <https://mloda-ai.github.io/mloda/>