Plugin API

class supervisely_lib.api.plugin_api.PluginApi(api)[source]

Bases: supervisely_lib.api.module_api.ModuleApi

API for working with plugins. PluginApi object is immutable.

Parameters

api (Api) – API connection to the server

Usage example
# You can connect to API directly
address = 'https://app.supervise.ly/'
token = 'Your Supervisely API Token'
api = sly.Api(address, token)

# Or you can use API from environment
os.environ['SERVER_ADDRESS'] = 'https://app.supervise.ly'
os.environ['API_TOKEN'] = 'Your Supervisely API Token'
api = sly.Api.from_env()

team_id = 8
plugin_info = api.plugin.get_list(team_id)
static info_sequence()[source]

NamedTuple PluginInfo information about Plugin.

Example
PluginInfo(id=3,
           name='DTL',
           description='Allows to combine datasets, to make class mapping, filter objects and images, apply auto augmentations and so on ...',
           type='dtl',
           default_version='latest',
           docker_image='docker.deepsystems.io/supervisely/five/dtl',
           readme='# Data Transformation Language (DTL)...',
           configs=[],
           versions=['lately', 'docs', ...],
           created_at='2020-03-30T09:17:36.000Z',
           updated_at='2020-04-23T06:26:29.000Z')
static info_tuple_name()[source]

NamedTuple name - PluginInfo.

get_list(team_id: int, filters: Optional[list] = None) → List[NamedTuple][source]

Get list of plugins in the Team.

Parameters
  • team_id (int) – Team ID in Supervisely.

  • filters (List[dict], optional) – List of params to sort output Plugins.

Returns

List of Plugins with information. See info_sequence

Return type

List[NamedTuple]

Usage example
os.environ['SERVER_ADDRESS'] = 'https://app.supervise.ly'
os.environ['API_TOKEN'] = 'Your Supervisely API Token'
api = sly.Api.from_env()

team_id = 8
plugin_info = api.plugin.get_list(team_id)

plugin_list_filter = api.plugin.get_list(team_id, filters=[{'field': 'name', 'operator': '=', 'value': 'Images'}])
get_info_by_id(team_id: int, plugin_id: int) → NamedTuple[source]

Get Plugin information by ID.

Parameters
  • team_id (int) – Team ID in Supervisely.

  • plugin_id (int) – Plugin ID in Supervisely.

Returns

Information about Plugin. See info_sequence

Return type

NamedTuple

Usage example
os.environ['SERVER_ADDRESS'] = 'https://app.supervise.ly'
os.environ['API_TOKEN'] = 'Your Supervisely API Token'
api = sly.Api.from_env()

plugin_info = api.plugin.get_info_by_id(8, 3)
print(plugin_info)
# Output: PluginInfo(id=3,
#                    name='DTL',
#                    description='Allows to combine datasets, to make class mapping, filter objects and images, apply auto augmentations and so on ...',
#                    type='dtl',
#                    default_version='latest',
#                    docker_image='docker.deepsystems.io/supervisely/five/dtl',
#                    readme='# Data Transformation Language (DTL)...',
#                    configs=[],
#                    versions=['lately', 'docs', ...],
#                    created_at='2020-03-30T09:17:36.000Z',
#                    updated_at='2020-04-23T06:26:29.000Z')
InfoType

alias of supervisely_lib.api.module_api.PluginInfo