Did not have time to test that yet! There are so many features in this package and still a lot more incoming, it's amazing! Are you prepping a "Turn An Excel Sheet Into An Interactive Dashboard Using Python, version 2" 🙃? I'm also pretty much convinced the most used streamlit-extras will eventually make their way into the Streamlit main library, so it's not like we are using features that may disappear 6 months later eheh
@@andfanilo I am not planning to make a v2 of the Sales Dashboard, but I will surely use streamlit-extras for other projects. Good to know that it will not disappear soon. I once created a tutorial around the streamlit-authenticator package. Shortly afterwards, the package was bumped to a new version, which was not backwards compatible .🙈 I received many complaints in the comments 😅
@@andfanilo I’m working on integrate label studio in my streamlit app and i need to make a button that submit the annotation in the current session. The shorcut is « ctrl + enter »
i am creating an app that displays cards, similar to the metric cards shown on the video. However, these display info from a table, each card correspoinding to a row. I am trying to implement a funcitonality in which these cards are clickable. I wan to be able to click any card, have its info saved in session state and switch to a different page. Right now i managed to make the cards clickable and switch page by using an href anchor. However this aproach refreshes the page and thus it is not able to maintian the session state. Do you know of any alternatives to be able to switch pages when clicking a card. I also tried using streamlit buttons but i havent found a way to style them as i want them
Hey there! Unfortunately my immediate reaction was to style a button with a st.switch_page, which is the only Streamlit method to switch page without a page refresh which loses session state, so something like: ``` import streamlit as st st.button("Does nothing") st.html(""" div[data-testid="stVerticalBlock"]:has(> div > .stHtml > .switch_button) button { padding: 1em 2em; border-left: 0.5rem solid red; box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15); & p { font-size: 1.3em; font-weight: 700; color: #174C4F; } } """) if "clicked" not in st.session_state: st.session_state["clicked"] = False with st.container(): st.html('') if st.button("Switch page"): st.session_state["clicked"] = True st.switch_page("pages/test1.py") st.button("Does nothing either") ``` But it's not as stylish as a metric card... ...but wait, another thing you could try, and I think would work actually: when you switch page with an href anchor, you can add values as query params and treat query params as your transitional session state. Don't href to localhost/test1 but instead to localhost/test1?coming_from=apple, then use docs.streamlit.io/develop/api-reference/caching-and-state/st.query_params at the start of your page to retrieve the query params, initialize session state with it and continue doing your thing. That should work out. Hope this helps!
I have no clue if RUclips correctly accepted my longer comment so here's a shorter version: Something you could try, when you switch page with an href anchor, you can add values as query params and treat query params as your transitional session state. Don't href to localhost/test1 but instead to localhost/test1?coming_from=apple, then use docs.streamlit.io/develop/api-reference/caching-and-state/st.query_params at the start of your page to retrieve the query params, initialize session state with it and continue doing your thing. That should work out. Hope this helps!
Is it possible to switch pages in a multi-page app when your main script file (ex: app.py) is in the main project folder (ex:Python Streamlit Project) and other pages are in a subfolder (ex:Pages)?
Hey Paul! I'm currently in holidays so I don't have a Streamlit project here, but from memory that's the only way this function works, by navigating to a script from the pages/ subfolder Have a nice day!
I Fanilo Andrianasolo. I love your videos. I'm every time learning new things about streamlit on your chanel. I need your help with something, the way you do to avoid reloading effect on you streamlit app. How you do that ?
Hey! I'm not sure I understand, are you talking about the whole reloading effect every time you interact with a widget? (if that's the case then no, you can't avoid it, but you can, through the usage of st.experimental_memo avoid the reloading of a complex function, and with session_state save results you want to preserve between reruns) Have a nice day!
Thanks @@andfanilo for your help. I tried experimental_memo and --runner.fastReruns true. It works. My app is more speed now and the reloading effect is almost invisible 🙏🏽
Hello, i need to load 5gb data into streamlit. And i try to deploy it to Streamlit Cloud however it take too long 3 days up to now still not finish. Can you help me
Hello! I'm currently in holidays so I couldn't look through it, but I think there's a storage limit on Streamlit Cloud. You can instead put the data in Github LFS (docs.streamlit.io/streamlit-cloud/troubleshooting#how-do-i-store-files-locally) or somewhere in the Cloud like in Amazon S3 or even Google Drive and then download/cache it at the beginning of your script with a Python library. Have a nice day!
I just remembered your st-card component this morning while looking inside the Components Tracker 🙃 I'll forever remember you as the origin story of the st-card eheh Hope you're doing well, and thanks for watching 🙂
@@andfanilo i try to install it by pip install st-pages but i have an issue : ERROR: Could not find a version that satisfies the requirement st-pages ERROR: No matching distribution found for st-pages
Sorry to hear you had a mediocre viewing experience. Hopefully you'll find other RUclipsrs that share similar info but in a delivery style you prefer. I won't be changing anything in my style, (and this video being one of my highest performing in views and retention tells me I should keep doing it this way), will keep refining it with your words in mind, I'm still learning :)
@@andfanilo believe me content is super just need to fine tune little bit like more video time and content and little bit less on wittyness. I know these videos has more views but you can exponentially grow it more
*Great video, Fanilo!* I also recently discovered the streamlit-extra package. My favourite feature is the dataframe explorer.
Did not have time to test that yet! There are so many features in this package and still a lot more incoming, it's amazing! Are you prepping a "Turn An Excel Sheet Into An Interactive Dashboard Using Python, version 2" 🙃?
I'm also pretty much convinced the most used streamlit-extras will eventually make their way into the Streamlit main library, so it's not like we are using features that may disappear 6 months later eheh
@@andfanilo I am not planning to make a v2 of the Sales Dashboard, but I will surely use streamlit-extras for other projects. Good to know that it will not disappear soon. I once created a tutorial around the streamlit-authenticator package. Shortly afterwards, the package was bumped to a new version, which was not backwards compatible .🙈 I received many complaints in the comments 😅
You are what streamlit community needs!!
Oh wow, thank you 🥺 I'm so grateful for you support 🤗 I hope we manage a small trustworthy community here, and that I'll see you around!
Dam I love your content, not only is it informative and helpful you always have fun with it! Keep up the great work 🙂
I’m very grateful for your support 🤩 it’s really reinvigorating, I’m hoping to continue on this path and I look forward to seeing you around again ☺️
Awesome video. Humble request ...kindly create a video without sidebar how to switch pages using button.
I NEEDED THIS RIGHT NOW AND IT WAS UPLOADED IT 10 HOURS AGO DAMN
Ahah surprise, I’m a mind reader 😆😆
Hello, Great video thank you.
I want to know if there is a way to make a button that launch a specific keyboard shortcut ? And how to do it ? Plse
Hello!
Out of my mind, I'm not sure it's easy to do, what kind of keyboard shortcut would you like to run from a button?
@@andfanilo I’m working on integrate label studio in my streamlit app and i need to make a button that submit the annotation in the current session. The shorcut is « ctrl + enter »
i am creating an app that displays cards, similar to the metric cards shown on the video. However, these display info from a table, each card correspoinding to a row. I am trying to implement a funcitonality in which these cards are clickable. I wan to be able to click any card, have its info saved in session state and switch to a different page. Right now i managed to make the cards clickable and switch page by using an href anchor. However this aproach refreshes the page and thus it is not able to maintian the session state. Do you know of any alternatives to be able to switch pages when clicking a card. I also tried using streamlit buttons but i havent found a way to style them as i want them
Hey there!
Unfortunately my immediate reaction was to style a button with a st.switch_page, which is the only Streamlit method to switch page without a page refresh which loses session state, so something like:
```
import streamlit as st
st.button("Does nothing")
st.html("""
div[data-testid="stVerticalBlock"]:has(> div > .stHtml > .switch_button) button {
padding: 1em 2em;
border-left: 0.5rem solid red;
box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
& p {
font-size: 1.3em;
font-weight: 700;
color: #174C4F;
}
}
""")
if "clicked" not in st.session_state:
st.session_state["clicked"] = False
with st.container():
st.html('')
if st.button("Switch page"):
st.session_state["clicked"] = True
st.switch_page("pages/test1.py")
st.button("Does nothing either")
```
But it's not as stylish as a metric card...
...but wait, another thing you could try, and I think would work actually: when you switch page with an href anchor, you can add values as query params and treat query params as your transitional session state.
Don't href to localhost/test1 but instead to localhost/test1?coming_from=apple, then use docs.streamlit.io/develop/api-reference/caching-and-state/st.query_params at the start of your page to retrieve the query params, initialize session state with it and continue doing your thing. That should work out.
Hope this helps!
I have no clue if RUclips correctly accepted my longer comment so here's a shorter version:
Something you could try, when you switch page with an href anchor, you can add values as query params and treat query params as your transitional session state.
Don't href to localhost/test1 but instead to localhost/test1?coming_from=apple, then use docs.streamlit.io/develop/api-reference/caching-and-state/st.query_params at the start of your page to retrieve the query params, initialize session state with it and continue doing your thing. That should work out.
Hope this helps!
@@andfanilo Using query params worked perfectly! thank you for your help!
Is it possible to switch pages in a multi-page app when your main script file (ex: app.py) is in the main project folder (ex:Python Streamlit Project) and other pages are in a subfolder (ex:Pages)?
Hey Paul! I'm currently in holidays so I don't have a Streamlit project here, but from memory that's the only way this function works, by navigating to a script from the pages/ subfolder
Have a nice day!
I Fanilo Andrianasolo. I love your videos. I'm every time learning new things about streamlit on your chanel. I need your help with something, the way you do to avoid reloading effect on you streamlit app. How you do that ?
I found an answer on this video ruclips.net/video/0mFwVBVu21c/видео.html
Hey! I'm not sure I understand, are you talking about the whole reloading effect every time you interact with a widget?
(if that's the case then no, you can't avoid it, but you can, through the usage of st.experimental_memo avoid the reloading of a complex function, and with session_state save results you want to preserve between reruns)
Have a nice day!
Thanks @@andfanilo for your help. I tried experimental_memo and --runner.fastReruns true. It works. My app is more speed now and the reloading effect is almost invisible 🙏🏽
Thanks man that was very useful ❤👍🏾👍🏾
Thanks for the support 😊
Good tuto,
I want to open pages on the new tab of browser . I tried with webbrowser but the page open without data it is empty.
Thank
🤔
Man, you are very funny and joker, thanks. Regards
Glad you enjoyed! :) see you soon!
Hello, i need to load 5gb data into streamlit. And i try to deploy it to Streamlit Cloud however it take too long 3 days up to now still not finish. Can you help me
Hello! I'm currently in holidays so I couldn't look through it, but I think there's a storage limit on Streamlit Cloud. You can instead put the data in Github LFS (docs.streamlit.io/streamlit-cloud/troubleshooting#how-do-i-store-files-locally) or somewhere in the Cloud like in Amazon S3 or even Google Drive and then download/cache it at the beginning of your script with a Python library.
Have a nice day!
Hey .. can you make a playlist of Chainlit ??
It's in my very long todo list of videos to make. Wait & see if that happens eventually :) thanks for sharing!
@@andfanilo thanks with love
I’d like to take credit for the cards😂. JK
Great work Fanilo
I just remembered your st-card component this morning while looking inside the Components Tracker 🙃 I'll forever remember you as the origin story of the st-card eheh
Hope you're doing well, and thanks for watching 🙂
Hahahaha yes vertical space IS just a loop of st.write, I just got tired of writing the same thing over and over!
Well that’s how the greatest hacks are made right 😁? I have the same feeling when I add a blank column to create a bigger horizontal gap ahah
if you can to do a lesson on how to create navbar with sub navbar
Maybe github.com/blackary/st_pages would work for you? 😊 haven’t tested it yet so if you test it, I’d love to hear your feedback on the package!
@@andfanilo thank you , i will test it and give you my feedback.
@@andfanilo i try to install it by pip install st-pages but i have an issue : ERROR: Could not find a version that satisfies the requirement st-pages
ERROR: No matching distribution found for st-pages
let me help you out .... dont try to be witty every 3 secs its overwhelming viewers ... although its good to have ....its been overloaded .
Sorry to hear you had a mediocre viewing experience.
Hopefully you'll find other RUclipsrs that share similar info but in a delivery style you prefer.
I won't be changing anything in my style, (and this video being one of my highest performing in views and retention tells me I should keep doing it this way), will keep refining it with your words in mind, I'm still learning :)
@@andfanilo believe me content is super just need to fine tune little bit like more video time and content and little bit less on wittyness. I know these videos has more views but you can exponentially grow it more