<!-- # hard line break macro for HTML -->

# fiftyone.plugins.context

FiftyOne plugin context.

Copyright 2017-2026, Voxel51, Inc.
<br/>
[voxel51.com](https://voxel51.com/)
<br/>
<br/>

**Functions:**

| [`build_plugin_contexts`](#fiftyone.plugins.context.build_plugin_contexts)([enabled])   | Returns contexts for all available plugins.   |
|-----------------------------------------------------------------------------------------|-----------------------------------------------|

**Classes:**

| [`PluginContext`](#fiftyone.plugins.context.PluginContext)(plugin_definition)   | Context that represents a plugin and the Python objects it creates.   |
|---------------------------------------------------------------------------------|-----------------------------------------------------------------------|

### fiftyone.plugins.context.build_plugin_contexts(enabled=True)

Returns contexts for all available plugins.

* **Parameters:**
  **enabled** (*True*) – whether to include only enabled plugins (True) or only
  disabled plugins (False) or all plugins (“all”)
* **Returns:**
  a list of [`PluginContext`](#fiftyone.plugins.context.PluginContext) instances

### *class* fiftyone.plugins.context.PluginContext(plugin_definition)

Bases: `object`

Context that represents a plugin and the Python objects it creates.

* **Parameters:**
  **plugin_definition** – the [`fiftyone.plugins.PluginDefinition`](fiftyone.plugins.md#fiftyone.plugins.PluginDefinition) for
  the plugin

**Attributes:**

| [`name`](#fiftyone.plugins.context.PluginContext.name)       | The plugin name.                                                         |
|--------------------------------------------------------------|--------------------------------------------------------------------------|
| [`secrets`](#fiftyone.plugins.context.PluginContext.secrets) | List of keys for required secrets as specified in the plugin definition. |

**Methods:**

| [`has_errors`](#fiftyone.plugins.context.PluginContext.has_errors)()             | Determines whether the plugin has errors.                      |
|----------------------------------------------------------------------------------|----------------------------------------------------------------|
| [`can_register`](#fiftyone.plugins.context.PluginContext.can_register)(instance) | Determines whether the given operator can be registered.       |
| [`register`](#fiftyone.plugins.context.PluginContext.register)(cls)              | Registers the given operator on the plugin.                    |
| [`register_all`](#fiftyone.plugins.context.PluginContext.register_all)()         | Registers all operators defined by the plugin on this context. |
| [`dispose_all`](#fiftyone.plugins.context.PluginContext.dispose_all)()           | Disposes all operators from this context.                      |

#### *property* name

The plugin name.

#### *property* secrets

List of keys for required secrets as specified in the plugin
definition.

#### has_errors()

Determines whether the plugin has errors.

* **Returns:**
  True/False

#### can_register(instance)

Determines whether the given operator can be registered.

* **Parameters:**
  **instance** – an [`fiftyone.operators.operator.Operator`](fiftyone.operators.operator.md#fiftyone.operators.operator.Operator)
* **Returns:**
  True/False

#### register(cls)

Registers the given operator on the plugin.

#### NOTE
Any errors are logged rather than being raised.

* **Parameters:**
  **cls** – an [`fiftyone.operators.operator.Operator`](fiftyone.operators.operator.md#fiftyone.operators.operator.Operator) or
  [`fiftyone.operators.panel.Panel`](fiftyone.operators.panel.md#fiftyone.operators.panel.Panel) class

#### register_all()

Registers all operators defined by the plugin on this context.

#### NOTE
Any errors are logged rather than being raised.

#### dispose_all()

Disposes all operators from this context.
