2. Utils
2.1
utils
2.1.1
check_credentials()
Checks whether credentials are available in the session state.
This function verifies if the credentials are stored in the Streamlit session state. If available, it shows a success message for 3 seconds, and returns True. If not available, it shows a warning message and returns False.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if credentials are available, otherwise False. |
Source code in src/utils/utils.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
2.1.2
config_streamlit_page(page_name)
Configures the Streamlit page settings based on the given page name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page_name
|
str
|
The name of the page that is being configured. |
required |
Source code in src/utils/utils.py
7 8 9 10 11 12 13 14 15 16 |
|
2.1.3
obtain_top(df, top, column)
Obtain the top 'n' rows from a DataFrame based on a specific column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
The DataFrame containing the data. |
required |
top
|
int
|
The number of top rows to return based on the column value. |
required |
column
|
str
|
The column name to sort the data by to determine the top rows. |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
A list of the top 'n' values from the specified column in the DataFrame. |
Source code in src/utils/utils.py
53 54 55 56 57 58 59 60 61 62 63 64 65 |
|