Login
Back to bricks list
Introduction Version

Settings

Settings class.

This class represents to global settings of the application.

:property data: The settings data :type data: dict

Attributes

data: Dict

Functions

__INIT__

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

Parameters:
NameTypeDefault valueDescription
datadict
ADD_BRICK
Parameters:
NameTypeDefault valueDescription
brick_infoBrickInfo
ADD_MODULE
Parameters:
NameTypeDefault valueDescription
module_infoModuleInfo
GET_ALL_PIP_PACKAGES
Return type:
List
GET_BRICK_DATA_DIR

Get the data directory of a brick. It contains the data downloaded for a brick.

Parameters:
NameTypeDefault valueDescription
brick_namestr The name of the brick ``
Return type:
str
GET_BRICK_DATA_MAIN_DIR

Get the main data director for the brick. It contains folder for each brick containing data of the brick.

Return type:
str
GET_BRICK_MIGRATION_LOG
Parameters:
NameTypeDefault valueDescription
brick_namestr
Return type:
Optional
GET_BRICK_MIGRATIONS_LOGS

Retrieve the list of all brick migrations

Return type:
Dict
GET_BRICKS
Return type:
Dict
GET_CWD

Returns the current working directory of the Application (i.e. the main brick directory)

Return type:
str
GET_DATA
Parameters:
NameTypeDefault valueDescription
kstr
defaultAny
Return type:
str
GET_DATA_DIR

Get the default data directory. Depending on if the lab is in dev or prod mode, the appropriate directory is returned.

Return type:
str
GET_FILE_STORE_DIR
Return type:
str
GET_GWS_CORE_DB_NAME
Return type:
str
GET_KV_STORE_BASE_DIR
Return type:
str
GET_LOG_DIR

Get the log directory

Return type:
str
GET_MARIA_DB_BACKUP_DIR
Return type:
str
GET_MODULES
Return type:
Dict
GET_NOTEBOOK_PATHS

Returns all the paths of all the brick used by the Application

Return type:
str
GET_PIP_PACKAGE
Parameters:
NameTypeDefault valueDescription
namestr
Return type:
Optional
GET_PIP_PACKAGES
Parameters:
NameTypeDefault valueDescription
namesList
Return type:
List
GET_SPACE
Return type:
SpaceDict
GET_VARIABLE

Returns a variable. Returns None if the variable does not exist

Parameters:
NameTypeDefault valueDescription
keyAny
Return type:
str
GET_VARIABLES

Returns the variables dict

Return type:
dict
IS_DESKTOP_LAB

True when lab is running on a desktop in prod mode

Return type:
bool
IS_LOCAL_DEV_ENV

True when lab is running locally in dev mode

Return type:
bool
SAVE
Return type:
bool
SET_CWD
Parameters:
NameTypeDefault valueDescription
cwdstr
SET_DATA
Parameters:
NameTypeDefault valueDescription
keystr
valAny
SET_PIP_FREEZE
Parameters:
NameTypeDefault valueDescription
pip_freezeList
SET_SPACE
Parameters:
NameTypeDefault valueDescription
spaceSpaceDict
SET_VARIABLE

Set a variable

Parameters:
NameTypeDefault valueDescription
keystr
valuestr
TO_DTO
Return type:
SettingsDTO
UPDATE_BRICK_MIGRATION_LOG

Add a new brick migration log and update last migration version

Parameters:
NameTypeDefault valueDescription
brick_namestr
versionstr
BUILD_LOG_DIR - @classmethod

Return the log dir

Parameters:
NameTypeDefault valueDescription
is_testbool
Return type:
str
CORE_API_ROUTE_PATH - @classmethod
Return type:
str
GET_COMMUNITY_API_URL - @classmethod
Return type:
str
GET_FRONT_URL - @classmethod
Return type:
str
GET_FRONT_VERSION - @classmethod

Returns the front version of the lab

Return type:
str
GET_GLOBAL_ENV_DIR - @classmethod
Return type:
str
GET_GWS_CORE_BRICK_NAME - @classmethod
Return type:
str
GET_GWS_CORE_DB_CONFIG - @classmethod
Return type:
DbConfig
GET_INSTANCE - @classmethod
Return type:
Settings
GET_LAB_API_URL - @classmethod
Return type:
str
GET_LAB_DEV_API_URL - @classmethod
Return type:
str
GET_LAB_ENVIRONMENT - @classmethod

Return the environment where the lab run ON_CLOUD : the lab is running on the cloud DESKTOP : the lab is running on a desktop LOCAL : the lab is running locally (for development purpose)

Return type:
Literal
GET_LAB_FOLDER - @classmethod
Return type:
str
GET_LAB_ID - @classmethod

Returns the name of the lab

Return type:
str
GET_LAB_NAME - @classmethod

Returns the name of the lab

Return type:
str
GET_LAB_PROD_API_URL - @classmethod
Return type:
str
GET_MAIN_APP_FOLDER - @classmethod
Return type:
str
GET_OPEN_AI_API_KEY - @classmethod

Return the open ai api key

Return type:
str
GET_ROOT_TEMP_DIR - @classmethod

Return the root temp dir

Return type:
str
GET_SPACE_API_KEY - @classmethod

Return the space api key

Return type:
str
GET_SPACE_API_URL - @classmethod

Return the space api url

Return type:
str
GET_STREAMLIT_HOST_URL - @classmethod

Returns the front version of the lab

Return type:
str
GET_STREAMLIT_MAIN_APP_PORT - @classmethod

Returns the front version of the lab

Return type:
int
GET_TEST_DB_CONFIG - @classmethod
Return type:
DbConfig
GET_USER_BRICKS_FOLDER - @classmethod
Return type:
str
GET_VIRTUAL_HOST - @classmethod

Return the virtual host of the machine like tokyo.gencovery.io

Return type:
str
GPU_IS_AVAILABLE - @classmethod

return true if the gpu is available

Return type:
bool
INIT - @classmethod
Return type:
Settings
IS_DEV_MODE - @classmethod
Return type:
bool
IS_LOCAL_ENV - @classmethod
Return type:
bool
IS_PROD_MODE - @classmethod
Return type:
bool
MAKE_TEMP_DIR - @classmethod

Make a unique temp dir

Return type:
str
RETRIEVE - @classmethod
Return type:
Settings