API Reference
The Spreadsheet Component
To display the Mito spreadsheet in a Streamlit application, use the following code:
Component API
Argument Name | Type | Explanation |
---|---|---|
| Pass any number of Pandas dataframes or paths to CSV files that will be displayed by in the Mito spreadsheet. | |
| A file path to a folder where users can import data from. Any subfolders will be available for navigation and importing within the Mito file browser. | |
| if you pass Pandas dataframes through the | |
| Pass functions that are available as spreadsheet functions in the Mito spreadsheet. See more here. (Mito Enterprise) | |
| Pass custom data importers that get an auto-generated UI. See more here. (Mito Enterprise) | |
| Pass Python functions that edit a dataframe to get an auto-generated Ui. See more here. (Mito Enterprise) | |
|
| Pass a |
|
| An optional list of |
| An optional key that uniquely identifies this component. Necessary if you have multiple Mito | |
|
| An optional string to identify what information you want from the |
|
| Sets default formula editing behavior. Formulas will either default to editing the entire column, or the specific cell being edited. If not set, defaults to editing the entire column. |
|
| An optional string to specify the height in pixels that you want to use for the mitosheet. ie: "900px" |
Return Types
By default, the spreadsheet
component returns:
new_dfs
: a Python dictionary from dataframe name to dataframe object. There will be one entry for each tab in the Mito spreadsheet.code
: a string that corresponds to the edits made by the user of the course of the Mito analysis.
MitoAnalysis Return Type
To easily rerun your analysis on new data, return the MitoAnalysis class through the return_type
parameter:
Other return types
selection
: the current selected cells in the mitosheetdefault_list
: similar to the default return type, but the dataframes are a list instead of a dictionarydfs_dict
similar to the default return type, but only returns the dict without the codecode
: similar to the default return type, but only return the codedfs_list
: returns a list of the dataframes generated by the analysis
Examples
Below are examples of common uses of the Mito spreadsheet component in a streamlit application.
Empty Mito Spreadsheet
Display a Dataframe for Editing
Display a CSV file for Editing
Displaying Mito generated code
Last updated