TeamFilesSelector
Introduction
TeamFilesSelector
is a graphic interface widget in the Supervisely platform that enables users to easily select files and/or folders from their Team files. It allows to customize selecting type (files, folder or both of this types) and displaying additional columns with information about files and folder (size, created date, updated date, type, mime type). The widget features a user-friendly interface and is optimized for performance, making it a valuable tool for teams working.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Team ID |
|
| Whether available selection multiple files/folders |
|
| Determine maximum height of the widget |
|
| Determine type of items available for selection |
|
| If |
|
| If |
|
| Determine column names to display additional information about files/folders |
|
| ID of the widget |
team_id
Team ID
type: int
multiple_selection
Whether available selection multiple files/folders
type: bool
default value: False
max_height
Determine maximum height of the widget
type: int
default value: 500
hide_header
If True
hide widget table header
type bool
default value: True
selection_file_type
Determine type of items available for selection
type: Literal["folder", "file"]
or None
default value: None
hide_empty_table
If True
and Team files directory is empty it will display message
type: bool
default value: True
additional_fields
Determine column names to display additional information about files/folders
type: List[Literal["id", "createdAt", "updatedAt", "type", "size", "mimeType"]]
default value: []
widget_id
ID of the widget
type: str
default value: ``
Methods and attributes
Attributes and Methods | Description |
---|---|
| Get list of path for selected files/folders in Team files. |
| Get list of selected files/folders information in Team files. |
| Set |
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/selection/012_team_files_selector/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Get team_id
from environment variables
team_id
from environment variablesInitialize TeamFilesSelector
widget
TeamFilesSelector
widgetCreate Text
, Button
widgets we will use in UI for demo
Text
, Button
widgets we will use in UI for demoCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Add functions to control widgets from code
Last updated