We have developers frequently endeavouring to embed page parameters in the URLs so others can share a URL to get to their current view of the app (which can be quite different from the default view).
It’s rather non-trivial getting that to work though, especially for app developers who are not hardcore programmers. It requires identifying the required parameters, managing them on the session state and handling the URL query string. Frequently they’ll run into problems (e.g. Erratic behavior in selectbox when the index parameter is not a constant · Issue #1532 · streamlit/streamlit · GitHub) and always their app code gets messy. More often than we’d like - they’ll avoid the effort of getting parameters to the URL entirely → no sharing capability.
Wondering how y’all handle this?
Some example code and a demo - with a class we’ve started putting together to hide/consolidate some of this machinery.
I just dealt with this issue and it was indeed a struggle. This is heading in the right direction. Is this a third party effort or something that would be part of streamlit core? Adopting any third party effort for something this fundamental is bound to be risky.
This is just an example of some code we are evolving internally at Toyota Research Institute / Woven to improve the situtation. If it helps guide others to finding a way to handle the problem in the short term, great. It’s main purpose though is to generate some discussion and eventually raise it more formally with the streamlit devs once I have some more feedback (internal & external).
Good idea. I liked the idea of a parameter registry. I’ve already encountered this as a blocker in a couple of situations where there is “parameter free for all.” I wanted to implement streamlit-analytics (a useful plugin) but immediately found that it had a conflict with its query parameter usage with hydralit, the multipage app that I already rely on. It would be great if parameters were registered with Streamlit central and given a unique identifier, ideally with a metadata directory of some sort. There’s no good reason for people to keep reinventing the same very similar parameters & functions.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.