[Share your feedback] What processes are a pain to build?

Hey Community :wave:! Streamlit PM here

What are the toughest, hackiest workflows youā€™re trying to build into your Streamlit apps today? :triumph:

We want to try and transform these frustrating workflows into fully supported APIā€™s. Please tell me about them in the comments below, so we can begin to address whatā€™s possible in the roadmap.

Thank you in advance!

7 Likes
  1. Authentication. It would be nice to have the big authentication providers (Google, Microsoft) to provide login to my Streamlit app and keep the user session across page reloads. Currently I am authenticating my users with login/password but the users complain on having to input login/password every time.

  2. Tailwind-like CSS. Currently the most hacky thing I do is inject custom CSS in my app through st.write() with unsafe_allow_html=True. But that has a lot of downsides, as the class of the elements I am assigning CSS to change over time and itā€™s really not very practical to have the CSS style in a file other than the file where my element is. As a React/Next.js developer, tailwind is the kind of technology that would be perfect for Streamlit, as every visual element could have a set of associated Tailwind utility style classes for an unlimited amount of customization.

  3. Set query params. Recently Streamlit introduced reading from query params, but setting them would also be awesome so users could share specific app state with other users. Would also be nice to have a validation to reading from query params like React has with Zod, or maybe some documentation, if Python has validation built in with Pydantic or something.

  4. Reactive pydeck/deck.gl chart. Everytime the data changes on my pydeck chart, the chart has to be completely regenerated. It would be nice to have a reactive wrapper that could stream the new data in the existing chart like what can be done using deck.gl, the native JavaScript library, and React.

  5. A better multi-select. Currently I am using third party components like StreamlitAntdComponents and streamlit-sortables for multiselect as the built in multiselect doesnā€™t allow sorting and is a little messy to select a lot of options.

  6. Next.js-like page prefetching. It would be nice to have a Next.js like page pre-fetching to increase the apparent performance of the web Streamlit app while navigating it.

11 Likes

I strongly agree with points 1 and 2 :raised_hand:

3 Likes

Hacking the original HTML templates for style, javascript, and html changes. Pretty easy to do though once you figure it out. An easier way to template that though would be nice.

Would be nice if I could custom load less default javascriptā€¦ just the parts I need to speed up loading.

Cookies and local storage (javascript in general) would be great too. So I do not have to hacky things to get the text input to start with the web focus or to make a nice button menu.

Oh, and packaging into smaller Docker images / containers is hard with some of the dependencies (Apache Arrow I think is one)

Thanks for the list so far!

The requests for Auth and cookies (and maybe even local storage??) are definitely on the roadmap and some of the next big things we want to tackle, stay tuned as I hope to post an update soon about thatā€¦

By the way @DarkCSS, setting query params is already supported today! you can do st.query_params["foo"] = "baz" and it will add ?foo=baz to your app URL.

Feedback definitely heard on the CSS and JS improvements. We actually had a recent conversation with some folks who work on deck.gl about possible improvements and better integration there but Iā€™m not sure about the timing. Agreed that would be awesome!

Taking notes on the other requests and +1s, and would love to hear more from other folks too! Thanks everyone!

2 Likes

Hi @jcarroll ! For me, it is:

  1. User session management (authentication, number of sessions, session lenght). I have even posted about it, but it did not gain much traction :slight_smile: I guess it is a problem mainly in corporate production enviroment.
  1. CSS injections (as mentioned above by @DarkCSS )
  2. JS injections - currently some hacky ways needed window.parent and so on.
2 Likes

Iā€™m with @DarkCSS in different points.

  1. I agree that authentication is something really awaited.
    Also when I talk to other people interested in Streamlit they ask how I manage authentication since there is not a straight way to do it.

  2. A more stable way to inject CSS and customize elements.

  3. I use pydeck too and I would like to have the same interactivity we have with streamlit-folium, since itā€™s much more powerful

1 Like

To add:

  • Long-running things and their graceful cancellation
  • Data row edit (pure pain, if you need an editable form)
  • Step-by-step processes (like, multi-step forms in chained steps)
  • Potentially destructive actions highlights (fool-proofing; could be easier with a dialog, havenā€™t checked yet)
1 Like

Hi there, greetings!
Donā€™t know what can be added or what is still there but I donā€™t see! But these are some issues which I found in my work so mentioning them here.

  1. Dedicated authentication mechanism

  2. Smooth multipage experience-opening pages in the same window or in a new window without losing states.

  3. Is there any option to run code for tabs only when they are clicked? So that I can save run time for my apps.

  4. Better experience with related process like button click ā†’ mutliple container opens (has buttons again) ā†’ clicking button here does some action. But I looose my containers, which were opened with the first button. I tried to do something with the recent fragment release, but there are issues with st.form_submit_required as it removes the forms when I click on the button inside a fragment function.

  5. Options to integrate other widgets like st.buttons, st.audio on dataframe columns if I have some data on a row I will click the button just present in other column to open a new tab or do something else.

  6. Can we have a component which displays limited amount of data on the container and shows next option(when limit reached) to show next(lets say 50 records/containers) data in the same conatainer without running the app again.

Thank you.

2 Likes

For point 1, I am using AWS Cognito with social login from Google and Facebook as IDP for my multi-page app and it seems to keep the cookies and session without having to requiring to login except upon expiry of the cookie (I think).

1 Like

For the folks who mentioned authentication - I wrote up a rough proposal of our current thinking here - take a look and leave comments please!

Also for folks asking about async / multi-threading, kicking off some more in-depth discussion on Github here: Feature Request: Add support for multi-threading/multi-processing in Streamlit Ā· Issue #8490 Ā· streamlit/streamlit Ā· GitHub

1 Like

Also one of the basic things, and important to add is the List views of different elements. So that i can create something like function of container() that will be used as item for showing in the list.

The way iā€™m using authentication creates a cookie that persists n days (can be changed). That way, once the user logs in, streamlit reads the cookie and displays the username on every pageā€¦ only if thhe session ends or the cookie expires they need to re-login

Hereā€™s a snippet:

def main():
import streamlit_authenticator as stauth
import yaml
from yaml.loader import SafeLoader

with open('/app/.streamlit/config.yaml') as file:
    config = yaml.load(file, Loader=SafeLoader)

authenticator = stauth.Authenticate(
    config['credentials'],
    config['cookie']['name'],
    config['cookie']['key'],
    config['cookie']['expiry_days'],
    config['preauthorized']
)
name, authentication_status, username = authenticator.login('main', 'sidebar')

if authentication_status:
    authenticator.logout('Logout', 'main')
    st.write(f'Welcome *{name}*')

ā€¦ (rest of the code)ā€¦

elif authentication_status is False:
    st.error('Username/password is incorrect')
elif authentication_status is None:
    st.warning('Please enter your username and password')

Authentication +1

Iā€™m using this workaround to use streamlit behind an oauth-proxy server (which logs my users in to Google): How to extract headers in streamlit app - #16 by zoltan-spire Adding an official request headers API seems like an easy win (for potentially other use cases too), that would make my authentication workflow a breeze.

I would love to see this officially supported as an API. I use it currently to get header and cookie information which I then use for authentication on my streamlit apps deployed on my companies network. I have found that it works really well but am worried it could be removed without notice. Seems to be the best way to get cookie information consistently, even better than custom components, which can often be a little buggy.

from streamlit.web.server.websocket_headers import _get_websocket_headers
headers = _get_websocket_headers()
1 Like