Does anyone have any recommendations on implementing deep links into a streamlit app? So that when a user with a link navigates to something like âwww.mystreamlitapp.com/economicsâ, streamlit would acknowledge and reconfigure the dashboard accordingly?
Hi @theimposingdwarf, welcome to the Streamlit community!
Work towards the functionality you are describing I believe is covered with this recently merged PR:
The idea here is that you can pass a URL that has the default values of widgets, so the app is in a specific state when you send the link to someone. It hasnât made it into a full release of Streamlit yet, but you can test it out by installing a recent nightly version:
pip install streamlit-nightly
If you do end up testing this, weâd love to know your experience, as this will help us refine the experience into the stable codebase.
Best,
Randy
Nice! This looks very capable.
I tried the most recent nightly build but none of the streamlit commands/functions were recognized in either the terminal or in my script. The build installed and would import without errors, there just seems to be nothing to it.
I tried the previous dayâs nightly build and the st.experimental_get_query_params()
works just fine at grabbing the information out of my custom typed URL.
The st.experimental_set_query_params()
doesnât appear to work. The documentation says itâs looking for a dict
object as input but when I actually tried to hand the function the dict
, a typeError
is thrown,
experimental_set_query_params() takes 0 positional arguments but 1 was given
Not really sure whatâs going on⊠the function definition says itâs looking for **query_params
.
Thanks for flagging that. I havenât had a chance to try this yet, but if youâre sure it doesnât work, please feel free to open a GitHub issue (or, wait a day or two until I can try it )
Just pulled the latest nightly build and things appear to be working fine now.
I was also likely using it incorrectly. I had thought it was looking for a dictionary object, instead the set function appears to want a list of keyword arguments, my bad.