Skip to content

streamlit

numerous.frameworks.streamlit

Module for integrating Numerous with Streamlit.

StreamlitCookieGetter

Source code in numerous/frameworks/streamlit.py
 9
10
11
12
13
14
15
16
class StreamlitCookieGetter:
    def cookies(self) -> dict[str, str]:
        """Get the cookies associated with the current request."""
        cookies = {key: str(val) for key, val in st.context.cookies.items()}
        if is_local_mode():
            # Update the cookies on the streamlit server
            session.set_user_info_cookie(cookies, local_user)
        return cookies

cookies()

Get the cookies associated with the current request.

Source code in numerous/frameworks/streamlit.py
10
11
12
13
14
15
16
def cookies(self) -> dict[str, str]:
    """Get the cookies associated with the current request."""
    cookies = {key: str(val) for key, val in st.context.cookies.items()}
    if is_local_mode():
        # Update the cookies on the streamlit server
        session.set_user_info_cookie(cookies, local_user)
    return cookies

get_session()

Get the session for the current user.

Returns:

Type Description
Session

The session for the current user.

Source code in numerous/frameworks/streamlit.py
19
20
21
22
23
24
25
26
27
def get_session() -> Session:
    """
    Get the session for the current user.

    Returns:
        The session for the current user.

    """
    return Session(cg=StreamlitCookieGetter())