5 Things I Wish I Knew Before Learning Streamlit

Sdílet
Vložit
  • čas přidán 15. 05. 2024
  • Would you like to understand the main limitations of the Streamlit Python library for building data web apps, before picking it up for a project?
    In this video, I'll cruise through 5 obstacles that regularly come back within the community and multiple ways/hacks/techniques to work around those limits. You'll find out:
    - how to hack markdown and iframe to style your app
    - if it's possible to alter the Streamlit rerun event loop and Tornado Backend server
    - thoughts to build a desktop app from your Streamlit app
    - where is the ipywidgets integration into Streamlit at
    After you watch me show you all those advanced techniques, you should have a good idea of Streamlit's limits and ways to go around Streamlit's "run from top to bottom philosophy" to meet your ends.
    ☕ Want to support me? www.buymeacoffee.com/andfanilo
    🐦Follow my daily updates on Twitter: / andfanilo
    🗣️ Find me on: andfanilo.com
    🔗 Links
    - Is Streamlit useful: discuss.streamlit.io/t/is-str...
    - Partial reruns: github.com/streamlit/streamli...
    - Using PyInstaller for Streamlit: discuss.streamlit.io/t/using-...
    - ipywidgets in Streamlit?: discuss.streamlit.io/t/ipywid...
    👉 My tools (Affiliate links to support me!)
    - 📷 Main Camera - amzn.to/3QvTosB
    - 📷 Main Lens - amzn.to/3svYCwq
    - 🎙️ Microphone - amzn.to/47l5ewA
    - 🎵 Music & Sound Effects - www.epidemicsound.com/referra...
    - 📕 Streamlit Official Book - amzn.to/3QuRPwl
    00:00 Intro
    00:45 Fixed Branding
    04:38 Looper
    08:31 Hidden Tornado Server
    12:17 Not an Executable
    17:02 Refuse ipywidgets
    20:30 Creativity in Constraints
    ______
    🖋 "Instead of freaking out about these constraints, embrace them. Let them guide you. Constraints drive innovation and force focus. Instead of trying to remove them, use them to your advantage." - 37Signals, Getting Real: The Smarter, Faster, Easier Way to Build a Web Application
    ⚠️ Disclaimer: This video is not sponsored, I receive no compensation by any brand quoted in this video. Views are my own and do not represent my employer's.
    Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. Thank you for supporting my channel so I can continue providing you with free content!
    #streamlit #python #datascience #dataapps

Komentáře • 47

  • @sehmiconscious
    @sehmiconscious Před 3 měsíci +4

    "Python loop-running machine" is the best description of Streamlit ever!

    • @andfanilo
      @andfanilo  Před 3 měsíci

      Ahah! well this description has been in my mind for a long time, and I really wanted to make a video around this looper idea, which was kind of the genesis for this video 😂

  • @mko-ai
    @mko-ai Před měsícem +1

    I dont know why this thumbnail with "streamlit is limited" is so genius, one of my favorite things.

  • @user-sc8uu2vx9r
    @user-sc8uu2vx9r Před 2 měsíci +4

    if anyone else on earth can understand this entire video you have reached god like status. this guy knows everything about everything

    • @andfanilo
      @andfanilo  Před 2 měsíci +1

      😆 next video "How to become a Streamlit God"

    • @pranitrock
      @pranitrock Před 2 měsíci

      I actually wanted to know the exact the about the libraries you shown in the video. Also I understood all of it, as I have developed in streamlit for a year them switched to nicegui also got the honour to provide a contribution to the library component of nicegui, have used panel little bit. But I am a bit disappointed you missed out flet and streamsync. These libraries deserve more love I believe. Still don't feel like God level status but ya some of my peers do say that while referring to me, but I am also hungry for even more more coding knowledge. 😅

    • @andfanilo
      @andfanilo  Před 2 měsíci +1

      @@pranitrock i did talk about flet at the end of the video 😁 I also missed on streamsync , taipy, chainlit, there are so many libraries to read about, try, compare, contribute to… so we must keep learning and pushing the boundaries of Python web apps! I personally don’t consider myself a god of Python ahah, I’m just a curious tech saavy user who loves to produce videos about my experiences :)
      Glad you’re enjoying the journey with NiceGUI. It’s a library I wanted to talk about in a video for a while, looking forward to have time to do one about it. If I could I would do a separate video for each of those libraries, but eh time is scarce 🤣

    • @pranitrock
      @pranitrock Před 2 měsíci

      @@andfanilo yup just noticed it at the end. I really enjoy your content. Keep up the good videos. 👍🏻

  • @z.r.777
    @z.r.777 Před 3 měsíci +4

    14:05 OMG! That was toooooo much truth. It's painfully accurate 😢

    • @andfanilo
      @andfanilo  Před 3 měsíci

      Ahah Every frickin’ time, maybe I should switch to Excel tutorials at this point 😂 how did it go with your users afterwards??

    • @CodingIsFun
      @CodingIsFun Před 3 měsíci

      @@andfanilo The most requested feature in every app: The download to Excel button. It is the story of my life 😅

    • @andfanilo
      @andfanilo  Před 3 měsíci

      Ahah it’s crazy how many times I’ve heard this from colleagues and customers 😂 how many legacy processes rely on Excel file processing I wonder ahah

  • @syedusa1611
    @syedusa1611 Před 3 měsíci +1

    Insightful.
    I tried to convert my streamlit app to desktop using electronJs but it seems like it doesn't support threading or queue.
    Similarly, I would appreciate if you could suggest some framework/libraries with modern ui components (like that of streamlit) for quick desktop app, which can be converted to executable file.

    • @andfanilo
      @andfanilo  Před 2 měsíci

      Hey, I've recommended Flet ( flet.dev/ ) in the video, that may be the one with the most "modern" look and uses Flutter SDK instead of PyInstaller to package. That *may* work around the threading/queue part
      The more native libraries like PySimpleGUI/Gooey/PyQT5 create executables that look pretty much like you classical Desktop app, but maybe if you're in a rush they will be helpful for you
      Packging a Python web app as an executable is an absolute pain, which is why I prefer to recommend deploying on an on-prem server or in the Cloud and send the URL to your colleague...I know it's not always possible but really, packaging web to desktop is a much worse experience 😕

  • @darkcss1054
    @darkcss1054 Před 3 měsíci

    Your videos, specially your Streamlit react component tutorial, have inspired me to dive deeper in the universe of JavaScript.
    I am planning to go the route of learning React.js, Next.js and TailwindCSS. Do you think it's a wise option to develop more large scale applications with authentication and data viz JS libraries? What path would you recommend?

    • @andfanilo
      @andfanilo  Před 3 měsíci +2

      Eheh :) I feel the deeper insight of my channel is to not be scared of JS and try it at least once
      One day at work, I was "attacked" by a senior architect telling me he would never put Dash code in production because he couldn't trust any Python framework generating React code. That's the day I started working on 2 Vue.js projects and going into the JS journey. Maybe it is still subconscious in my videos 😂
      Maybe not "large-scale", but I do think it's good to build a small SPA in full JS with 2-3 input + graphs and some CSS animations at least once in your life (not FastAPI serving Next.js, but going the full Node.js route).
      Then you get a grasp of how Streamlit/Dash generate React code, if you need to explain architects how those can be optimized. Ultimately you should feel comfortable with Python libraries like Solara or NiceGUI, or even spin your FastAPI serving HTMX/Alpine.js or SvelteKit/Next.js, for tools that are more "flexible", less "black-box magic" than Streamlit
      React/Next.js is a great option, React has so many great libraries. Yet if I were to do a new side project for a video right now, I'd look at Svelte/SvelteKit, the barrier of entry looks far lower and closer to HTML/CSS/JS than React is, so you "should" get at quicker results. Plus you can write Svelte components in both Streamlit and Gradio, a good win.
      I'd keep Tailwind for CSS.

  • @Sonntagssoziologe
    @Sonntagssoziologe Před 28 dny

    I had to cry because of my Streamlit lessons. Lost in time like tears in the rain.

  • @PauloRoberto-vj4jb
    @PauloRoberto-vj4jb Před 2 měsíci

    Hello!!
    Hey, thanks for your content on streamlit, very helpful!
    Is there a channel in with we can send questions for you?
    I’m struggling with the intent to put a image logo above multi-page apps structure, but I dont know nothing about FE/CSS :D
    Thank you in advance sir

    • @andfanilo
      @andfanilo  Před 2 měsíci

      Hello!
      I have no « FAQ » channel like this for now (because time is short 😅) but maybe check github.com/arnaudmiribel/streamlit-extras/extras/app_logo/
      Have a nice day!

  • @VictorDlocalhost
    @VictorDlocalhost Před 3 měsíci

    Buen video. Seria genial interactuar con los eventos de los puntos de las figuras de los graficos con Ploty asi como highchart para poder recargar otras componenentes de la aplicación.

    • @andfanilo
      @andfanilo  Před 3 měsíci +1

      Sí, necesitamos construir y mantener un nuevo proyecto para esto. Si eres valiente puedes hacerlo tu mismo :) dev.to/andfanilo/streamlit-components-scatterplot-with-selection-using-plotly-js-3d7n

    • @VictorDlocalhost
      @VictorDlocalhost Před 3 měsíci

      @@andfanilo mmmmmmm

  • @maxlgemeinderat9202
    @maxlgemeinderat9202 Před 3 měsíci +1

    Can you confidently sell Streamlit apps (eg. Llm Chat Rag App) to clients or would you more lile switch to an alternative?

    • @andfanilo
      @andfanilo  Před 3 měsíci +5

      I've seen multiple manual monetization strategies:
      - Stripe integration + Google Auth with st-paywall github.com/tylerjrichards/st-paywall (could probably build an easier way through Gumroad License keys for example)
      - embedding a Streamlit app in an of a paywalled website, or as an external web service behind a Javascript paywall
      - deploying a private Streamlit app to Streamlit Cloud and adding authorized email accounts of people that paid
      - just selling an app as a final product of a paid consultation, deployed on their servers or in your own Cloud project with limited access
      But so far no native answer for this. I do think the other Python solutions require as much stitching as Streamlit. Though managing subscription might be easier in other solutions like Dash, they will require a bit of coding
      I should write this down as a video idea for later 🤔

    • @cgagel607
      @cgagel607 Před 2 měsíci

      ​@@andfanilo I would love a video like this, I'm a big fan of your content and contributions to the Streamlit community!
      Where do you see Streamlit in the next 2-3 years? There have already been so many nice features added in just the last 2 years, do you think the gaps in the Streamlit framework you mentioned may be fixed in the future?

  • @socassiopee
    @socassiopee Před 3 měsíci

    Petit cœur pour le référencement, comme convenu 🙃

    • @andfanilo
      @andfanilo  Před 3 měsíci

      Non CZcams, promis ce n'est pas un robot payé pour booster mes vidéos 😂
      Merci pour le soutien 🙂 je pense que tu peux me trouver à peu près partout sur le Web avec mon nom de profil!

  • @nessrinetrabelsi8581
    @nessrinetrabelsi8581 Před 16 dny

    What about mobile apps? If I want to have a multi/cross-platform code, is streamlit suitable? or do you recommend another similar tool/framework?

    • @andfanilo
      @andfanilo  Před 12 dny +1

      Streamlit builds a responsive web app, so you can access the url from a smartphone and the app will adapt to the screen size
      But it’s not a native mobile app. The only Python alternative I heard about for cross platform is Flet, though I have not tried it yet
      If you do try it, I’d love your feedback here!

    • @nessrinetrabelsi8581
      @nessrinetrabelsi8581 Před 12 dny

      @@andfanilo Thank you!

  • @dhmkkk
    @dhmkkk Před 2 měsíci

    Hi Love your videos would you consider making some videos on chainlit would be fun !!

    • @andfanilo
      @andfanilo  Před 2 měsíci

      Hello, thanks for the support!
      I’ve been asked multiple times about chainlit, I think I’m going to do a poll about it 🙃 what would you like to see in a chainlit video ?

    • @dhmkkk
      @dhmkkk Před 2 měsíci

      @@andfanilo I have seen people make simple chatbots on youtube but making a custom chatbot modifying the ui like you do in streamlit but for chainlit would be something interesting i guess!

    • @andfanilo
      @andfanilo  Před 2 měsíci +1

      @@dhmkkk I like this idea 😀 my "hacky customize Streamlit" videos do seem to do pretty well, a Chainlit version could be a great outlier on CZcams!

    • @dhmkkk
      @dhmkkk Před 2 měsíci

      @@andfanilo great looking forward to it!!!

  • @larrysonjoelrakotonarivo3802

    salut ^_
    Mba mangataka vidéo teny gasy ra mba mety :)
    Streamlit to exe file :')
    Fa mahay ianao ^^