> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# atoti.plugin_measure()

### atoti.plugin\_measure(\*args, plugin\_key)

Return a measure computed by a plugin registered by an [Atoti Server extension](https://docs.activeviam.com/products/atoti/server/6.2/docs/starters/how-to/create-custom-measures).

<Warning>
  This feature is [`experimental`](./atoti.experimental#atoti.experimental), its key is `"plugin_measure"`.
</Warning>

* **Parameters:**
  * **args** (*NestedPluginMeasureArgs*) –

    The arguments forwarded to the measure plugin.
    Supported types include:

    * Scalar (any non-array [`data type`](./atoti.type#module-atoti.type))
    * [`Column`](./atoti.column#atoti.Column)
    * [`Hierarchy`](./atoti.hierarchy#atoti.Hierarchy)
    * [`Level`](./atoti.level#atoti.Level)
    * Any [`dict`](https://docs.python.org/3/library/stdtypes.html#dict), [`list`](https://docs.python.org/3/library/stdtypes.html#list) or [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple) of the above types.
  * **plugin\_key** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – The key of the measure plugin.
* **Return type:**
  *MeasureDefinition*

### Example

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> session_config = tt.SessionConfig(extra_jars=[server_extension_jar_path])
>>> session = tt.Session.start(session_config)
>>> df = pd.DataFrame(
...     [("Phone", 2), ("Watch", 4), ("Laptop", 1)],
...     columns=["Product", "Quantity"],
... )
>>> table = session.read_pandas(
...     df,
...     keys={"Product"},
...     table_name="Example",
... )
>>> cube = session.create_cube(table)
>>> l, m = cube.levels, cube.measures
```

The Atoti Server extension used provided by `server_extension_jar_path` contributes a measure plugin with the key `"MY_INCREMENT"`:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> with tt.experimental({"plugin_measure"}):
...     m["Incremented quantity.SUM"] = tt.plugin_measure(
...         m["Quantity.SUM"].name, l["Product"], 2, plugin_key="MY_INCREMENT"
...     )
>>> cube.query(
...     m["Quantity.SUM"],
...     m["Incremented quantity.SUM"],
...     levels=[l["Product"]],
... )
        Quantity.SUM Incremented quantity.SUM
Product
Laptop             1                        3
Phone              2                        4
Watch              4                        6
```
