data_source

class virtualitics_sdk.elements.data_source.DataSource(title='', options=None, value='', description='', show_title=True, show_description=True, required=True, label='', placeholder='')

Bases: InputElement

A Data Source Input Element.

Parameters:
  • title (str) – The title of the element, defaults to ‘’.

  • options (Optional[List[str]]) – The type of data input (s3/sql/csv/xlsx).

  • value (str) – The file name/pointer to the data source.

  • description (str) – The element’s description, defaults to ‘’.

  • show_title (bool) – Whether to show the title on the page when rendered, defaults to True.

  • show_description (bool) – Whether to show the description to the page when rendered, defaults to True.

  • required (bool) – Whether a file needs to be submitted for the step to continue, defaults to True.

  • label (str) – The label of the element, defaults to ‘’.

  • placeholder (str) – The placeholder of the element, defaults to ‘’.

EXAMPLE:

# Imports 
from virtualitics_sdk.elements.data_source import DataSource
. . .
# Example usage
class DataUploadStep(Step):
 def run(self, flow_metadata):
     . . .
     data_source = DataSource(
         title="Upload data here!",
         options=["csv"],
         description="Example datasource usage",
         required=True,
     )
     data_card = Card(title="Data Upload Card", content=[data_source])

The above DataSource example will be displayed as:

../_images/data_source_ex.png
get_value()

Get the value of an element. If the user has interacted with the value, the default will be updated.

Return type:

str