How to use Streamlit session states and callback functions | Make your apps remember things!

Поділитися
Вставка
  • Опубліковано 16 жов 2024

КОМЕНТАРІ • 85

  • @denisblack9897
    @denisblack9897 9 місяців тому +1

    One of my buddies spent like 2 weeks to grasp these concepts and you helped me to do it in 15min!
    Thank you a lot!

  • @curtisjackson3377
    @curtisjackson3377 2 роки тому +3

    Wow, I was wondering how I can bring my idea to real life using Streamlit and boom I found your video for session states....Many thanks for your time and am very grateful to have found your channel

    • @misraturp
      @misraturp  2 роки тому

      That's awesome Curtis! Thank you for your nice words and of course, you are welcome :)

    • @chriskeo392
      @chriskeo392 Рік тому

      Boom

  • @andresvodopivec5950
    @andresvodopivec5950 Рік тому +1

    This is the most straightforward yet most understandable and practical way of explaining session states. What a talent!!!! Thank you so much for your time. I subscribed to your channel.

  • @MrAdhityas
    @MrAdhityas 2 роки тому +1

    what a coincidence, i'm in the middle of creating a streamlit webapp for work, this really helps. thank you ms. , and thank you youtube algorithm

    • @misraturp
      @misraturp  2 роки тому

      Awesome coincidence! Good luck with the project!

  • @jeffoberlander3346
    @jeffoberlander3346 8 місяців тому

    This just made my day. Solved a problem I've been stuck on all day. Thank you!

  • @parttimelarry
    @parttimelarry 3 роки тому

    great demo, very easy to follow. will try this feature soon. thanks!

    • @misraturp
      @misraturp  3 роки тому

      Thank you! Have fun with Streamlit.

  • @qulta.digital
    @qulta.digital 6 місяців тому

    forever searching for this!! thank you

  • @mohz832
    @mohz832 2 роки тому

    best video so far about session states in Streamlit. Thanks!

  • @santhoshreddykesavareddy1078
    @santhoshreddykesavareddy1078 3 роки тому +5

    Wow! Well explained and very simple to understand and to start coding. Thank you for the video :). If possible can you please make a video using Streamlit extracting the data from any database with the help of user inputs in this way users can pull the data depending on the date selections. Thank you so much appreciate it :)

  • @RomarioCostaBarros
    @RomarioCostaBarros Рік тому

    great video. One tip to increase your visibility on the platform is to enable content translation. so people from other countries could have access to its content.

  • @TiagoSilva-ii9rq
    @TiagoSilva-ii9rq 2 роки тому

    Thank you . I am creating a web app with streamlit and this is exactly what I need !!

  • @Han-ve8uh
    @Han-ve8uh 2 роки тому +1

    Could you explain the "if st.session_state.kind_of_column"? When would this be not set or set? Docs say "Every widget with a key is automatically added to Session State". This sounds like it will not be set on 1st run because handle_click_wo_button will not be called assuming no changes done to the radio button right?

  • @cssensei610
    @cssensei610 2 роки тому +1

    Hey Misra,
    Just a “semantic” suggestion:-line 15 & line 20-the button labels should be “Show more ROWS” not columns
    since when you’re passing the “number_of_rows” to head (and the session variable name itself represents that)

    • @misraturp
      @misraturp  2 роки тому

      Thanks for the correction! I missed it apparently. :)

  • @mikemihay
    @mikemihay Рік тому

    Thank you for sharing this video! Very useful tips!

  • @louispetitjean1652
    @louispetitjean1652 3 роки тому

    Simply the best. I use your tutorials all the time :)

    • @misraturp
      @misraturp  3 роки тому +1

      Great to hear Louis! Thank you.

  • @tgard007
    @tgard007 8 місяців тому

    Fantastically done video thank you

  • @mustafayalcn6604
    @mustafayalcn6604 Рік тому

    thanks for your beautiful explanations. waiting your new videos.

  • @ibaha411
    @ibaha411 Рік тому

    Did you post the code you used here for people to download? Where is it?

  • @Han-ve8uh
    @Han-ve8uh 2 роки тому

    I wish to confirm that the problems in this video only occur because of the ordering of the commands right? Assuming we put the radio above the dropdown, there would be no need for callbacks?

  • @loukas2060
    @loukas2060 4 місяці тому

    Very helpful. Thanks!

  • @mrrobot6619
    @mrrobot6619 Рік тому

    Hi there. Thanks for all your effort. The questions that is have is do you know how to save the sesssion state of a radio button or a multi select? I can't get it to work. All other session states are working just fine....

  • @paulkabiito8355
    @paulkabiito8355 9 місяців тому

    Hi, thanks for your awesome videos, could you please help with the print/ save as pdf function for a desired output or page in streamlit

  • @fponce78
    @fponce78 Рік тому

    Hi ! does the on-change work using forms? I'm trying to do a nested select box in a form and I couldn't find out how to make it work, hope you have a solution. Thanks

  • @hamzaahmad564
    @hamzaahmad564 2 роки тому

    hey misra
    is it possible to use this for sliders? i'm thinking how this can be used as a workaround to programatically change the value of a slider.

  • @fatihgunduz9350
    @fatihgunduz9350 Рік тому

    Hey Mısra, I have three multiselect in sidebar. I want to revise multi select data according to each other. How do ı make. Can you help me?. thanks in advance

  • @SourabhSharma-y7j
    @SourabhSharma-y7j Рік тому

    How do we set callbacks when using third-party plugins like streamlit_plotly_events? When I click on the plot it refreshes the page without updating the variable state. :(

  • @ibaha411
    @ibaha411 Рік тому

    Is there a way to make the table editable? Could the user change values in the table?

  • @davutlu60
    @davutlu60 2 роки тому

    Çok sagol Mısra, cok yardımcı oldu... Kolaylıklar..

    • @misraturp
      @misraturp  2 роки тому

      Sevindim. :) Kolay gelsin!

  • @pydraktor
    @pydraktor Рік тому

    Hello, do u know how I can handle serveral dataloader on the same site preventing from uploading each, if only one changes. Not being sure if the on change would do the trick. Anyway confused if a dataloader hilds already the data or only the path and meta data and must be later read like pandas.read_csv(st.dataloader(...)) to use it. My RAM looked a bit like st.dataloader already loads to RAM

  • @jimpenner96
    @jimpenner96 2 роки тому

    What if you wanted data that after 6 years, the data from year 1 isnt necessary. I am thinking here of where there are calculations in your data and they are only needed on a rolling 5 years period?

  • @maxpandora995
    @maxpandora995 Рік тому

    Is it possible say there is a search box where a user can enter a search term, then the data frame will be filtered to show only the rows that contains that search term? Could you please do a video on that?

    • @misraturp
      @misraturp  Рік тому +1

      Sure that's possible Max. The display will happen through Streamlit but the filtering should happen on Pandas.

    • @maxpandora995
      @maxpandora995 Рік тому

      @@misraturp thank you.

  • @prateeksenapati2152
    @prateeksenapati2152 3 роки тому

    This is very helpful, thank you!

    • @misraturp
      @misraturp  3 роки тому +1

      You are very welcome :)

  • @jaggyjut
    @jaggyjut 2 роки тому

    Awesome tutorial. Thank you. Could create a tutorial on how to build an invoice form in which one can multiple items dynamically. For example click a button to add a new line item

    • @misraturp
      @misraturp  2 роки тому +1

      Thanks! I'll look into it.

    • @jaggyjut
      @jaggyjut 2 роки тому

      @@misraturp thank you. Im trying to convert an excel rent calculator to a streamlit web app. Depending on the number of household members, require ability to add new rows. Ideally fields are tenantno, income type and income amount.

  • @sandeepbhragava3165
    @sandeepbhragava3165 2 роки тому

    I am executing below code however the function that should be called after the button is clicked its called even before the button is clicked
    with st.form(key='form1'):

    table_name1 = st.text_input("enter table name to extract data from ","")
    but1 = st.form_submit_button(label='Submit to add fields and condition', on_click=shw_form2())
    Could you please let me know what the issue is, Thanks!

    • @misraturp
      @misraturp  2 роки тому

      Hey Sandeep, do you mean the text_input is called before the button click?

  • @sandeepbhragava3165
    @sandeepbhragava3165 2 роки тому

    Hi Misha,
    Have a general question on multiselect option in streamlit. I basically have a multiselect button to which I am passing a list of values. This multiselect is within a form as I only want it to save once the user click on the submit button.
    Unfortunately when I click on the submit button, all the items selected from.the list are not getting saved. I also tried saving it in session_state field.
    Can you please help.here I to use multiselect within a form and save the selected items.
    Thanks!!

    • @misraturp
      @misraturp  2 роки тому

      Hey Sandeep, would be hard for me to see what's going wrong without seeing the code unfortunately.

  • @Antonio-bm8hv
    @Antonio-bm8hv Рік тому

    Hi Misra, thanks for your explanations. I am trying to apply your code in my Streamlit project without success. Briefly, I am preparing a questionnaire where the user goes through different questions and can respond based on a drop down list. The goal is that the user cannot reedit the answers and the code force him/her to resolve the next question and so on. However, as the project is now, the user can reedit the questions and when the user moves to the next one and answer it, the code starts from beginning losing all the info generated. Could you please help?

    • @misraturp
      @misraturp  Рік тому +1

      Hey Antonio, maybe starting with a simpler app to understanding the logic of the session states could help? This sounds like a bit of a complicated project.

  • @eben4732
    @eben4732 2 роки тому

    Hello Misra, I followed the tutorial carefully, but I get the error, KeyError, when I select a column and run the code.

    • @misraturp
      @misraturp  2 роки тому

      For which line are you getting this error exactly?

  • @cobrakevg
    @cobrakevg 2 роки тому

    I need some help i can't put 2 pieces of code together. everytime i do they open in 2 different tabs in chrome. how can i make them open in 1 tab? i have the codes i can send them please its urgent

    • @misraturp
      @misraturp  2 роки тому

      Which command are you using to run the app?

  • @newlife4353
    @newlife4353 Рік тому

    could you please make a view how to integrate Dropbox refresh access token to steamlit?

  • @junevesstein1
    @junevesstein1 5 місяців тому

    love your videos, but now streamlit has updated its documentations and I can nt find anything anymore :( anyway, thanks for the video!!!!!!

  • @samhudaya7549
    @samhudaya7549 Рік тому

    Knowledge and beauty

  • @JonathanFuchs4444
    @JonathanFuchs4444 2 роки тому

    thanks!
    that was great

  • @arturocdb
    @arturocdb 3 роки тому

    Very useful, thank you

  • @gbennett1000
    @gbennett1000 Рік тому

    You are awesome

  • @shreemunpranav675
    @shreemunpranav675 28 днів тому

    Hi ,
    I am trying to implement user timeout in streamlit but unable to do so. Anyone who has figured it out????

  • @thepresistence5935
    @thepresistence5935 2 роки тому

    what IDE are you using?

    • @misraturp
      @misraturp  2 роки тому

      I am using the Sublime text editor.

  • @compton8301
    @compton8301 3 роки тому

    Thank you! :)

    • @misraturp
      @misraturp  3 роки тому

      You are very welcome. :)

  • @josevicenteruizcaro8536
    @josevicenteruizcaro8536 3 роки тому

    Thanks!!))

  • @vaibhavk2430
    @vaibhavk2430 2 роки тому

    can you send email using streamlit without using less secure option in gmail.

    • @misraturp
      @misraturp  2 роки тому

      Never tried this honestly.

  • @comar8886
    @comar8886 10 місяців тому

    🇧🇷🖥️

  • @Hamzaelbouti
    @Hamzaelbouti 2 роки тому

    sorry ... stil to small ... but great tutorial

    • @misraturp
      @misraturp  2 роки тому

      I'm working on it :D Can't fix the old videos but the latest ones I try to make it as big as possible.

  • @misraturp
    @misraturp  3 роки тому

    👉 Download the Streamlit project template to get going in no time - misraturp.gumroad.com/l/stemp

  • @josevicenteruizcaro8536
    @josevicenteruizcaro8536 3 роки тому

    Thanks :))