Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
1
Share

StreamlitApp

Class to manage a streamlit app that runs inside the main streamlit app

The path of this streamlit app code is passed to the main streamlit app as a parameter of the url. The main streamlit app load and run this app code.

Attributes
app_folder_path: str | Noneenable_debugger: boolname: strparams: dict | Nonerequires_authentication: boolresource_model_id: strresources: list[gws_core.resource.resource.Resource] | Nonestreamlit_code: str | None
Functions
__init__

Initialize self. See help(type(self)) for accurate signature.

resource_model_id : str
name : str
shell_proxy : ShellProxy
requires_authentication : bool - True
build_code

Generate the streamlit app code if this is using streamlit_code attribute.

app_dir : str
The directory where app files should be generated (already created)
get_app_folder_path

Get the app folder path where the main.py is located.

Return type : str
get_app_type

Get the type of the app.

Return type : AppType
get_shell_proxy
Return type : ShellProxy
get_source_ids

Get the source ids of the app

Return type : list
get_user_main_file_path

Get the user's main.py file path.

Return type : str
is_dev_mode
Return type : bool
is_virtual_env_app
Return type : bool
set_dev_mode
set_dev_user

Set the user to be used in dev mode and return the user access token

user_id : str
set_enable_debugger
enable_debugger : bool
set_input_resources

Set the resources of the app

: param resources: description : type resources: List[str]

resources : list
set_params
params : dict
set_requires_authentication

Set if the app requires authentication. By default it requires authentication. If the app does not require authentication, the user access tokens are not used. In this case the system user is used to access the app.

: param requires_authentication: True if the app requires authentication : type requires_authentication: bool

requires_authentication : bool
set_streamlit_code
streamlit_code : str
set_streamlit_code_path
streamlit_app_code_path : str
set_streamlit_folder
streamlit_folder_path : str
to_dto
Return type : AppInstanceDTO
was_generated_from_resource_model_id

Return true if the app was generated from the given resource model id

resource_model_id : str
Return type : bool
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.