5 Things I Wish I Knew Before Learning Streamlit

Поделиться
HTML-код
  • Опубликовано: 27 июн 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.
    📧 My email list to keep up to date with the latest news, tutorials and resources about Streamlit & friends ➡ andfanilo-newsletter.streamli...
    💰 Buy me a coffee to stay awake while editing ➡ www.buymeacoffee.com/andfanilo
    🗣️ Find my socials ➡ 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

Комментарии • 65

  • @sehmiconscious
    @sehmiconscious 4 месяца назад +6

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

    • @andfanilo
      @andfanilo  4 месяца назад

      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 3 месяца назад +1

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

  • @saisaigraph1631
    @saisaigraph1631 Месяц назад

    not only educative but also entertaining + fun... Thank you very much Fanilo

    • @andfanilo
      @andfanilo  Месяц назад

      Thank you for the kind words 🙂 hope to see you on the next video!

  • @data01010
    @data01010 10 дней назад

    loved the video delivery, kudos

    • @andfanilo
      @andfanilo  9 дней назад

      Thanks a ton for the support :) see you in the next one !

  • @z.r.777
    @z.r.777 4 месяца назад +4

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

    • @andfanilo
      @andfanilo  4 месяца назад

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

    • @CodingIsFun
      @CodingIsFun 4 месяца назад

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

    • @andfanilo
      @andfanilo  4 месяца назад

      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

  • @Sonntagssoziologe
    @Sonntagssoziologe 2 месяца назад

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

  • @darkcss1054
    @darkcss1054 4 месяца назад

    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  4 месяца назад +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.

  • @user-sc8uu2vx9r
    @user-sc8uu2vx9r 4 месяца назад +6

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

    • @andfanilo
      @andfanilo  4 месяца назад +1

      😆 next video "How to become a Streamlit God"

    • @pranitrock
      @pranitrock 4 месяца назад

      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  4 месяца назад +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 4 месяца назад

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

  • @zkiyyeller3525
    @zkiyyeller3525 Месяц назад

    Awesome Video which tts did you use for this? for the tldr? 1176 seconds

    • @andfanilo
      @andfanilo  Месяц назад

      Hello, thanks for watching! It was probably ElevenLabs for this video 🤔 ( elevenlabs.io/ )

  • @syedusa1611
    @syedusa1611 4 месяца назад +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  4 месяца назад

      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 😕

    • @theexposer9483
      @theexposer9483 Месяц назад

      The more you dig deep in Streamlit more dead ends you will find. It is not for any serious stuff, even thinking of using websocket as data pipe in Streamlit is prohibited .

  • @PauloRoberto-vj4jb
    @PauloRoberto-vj4jb 4 месяца назад

    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  4 месяца назад

      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!

  • @socassiopee
    @socassiopee 4 месяца назад

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

    • @andfanilo
      @andfanilo  4 месяца назад

      Non RUclips, 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!

  • @VictorDlocalhost
    @VictorDlocalhost 4 месяца назад

    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  4 месяца назад +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 4 месяца назад

      @@andfanilo mmmmmmm

  • @saylip2674
    @saylip2674 12 дней назад

    I was trying create a streamlit app to plot a 2D slice of a brain region and I want to add and delete points from that 2D slice respresentation. Is it possible through the streamlit app to make it interactive? Like the user can click on any co-ordinate and add a point or click on an existing point and delete it? Is it possible or should I use some other app? Please can you guide me?

    • @andfanilo
      @andfanilo  11 дней назад

      Hello!
      I think it would be possible with drawable canvas, but I wonder with the switching between multiple 2D slices + manipulating add/deletion for each 2D slice level and storing all point info in session state, all with Streamlit rerunning on every interaction, if Streamlit is the best bet...
      Haven't tried it, but usually I check Gradio after Streamlit before checking Panel/Dash/Solara...Gradio seems to let you access clicked point coordinates of the image eventdata with the Image.select() method natively ( github.com/gradio-app/gradio/pull/3786 & github.com/gradio-app/gradio/blob/main/demo/image_selections/run.py ) and you can edit the slice after reacting to the event.
      I can't try it yet, because I'm out of home for a few days to film a corporate event, but this right now would be my first try. I'll let you know if I stumble on another idea. I hope my writing while travelling makes a bit of sense :)

  • @nessrinetrabelsi8581
    @nessrinetrabelsi8581 Месяц назад

    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  Месяц назад +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 Месяц назад

      @@andfanilo Thank you!

  • @maxlgemeinderat9202
    @maxlgemeinderat9202 4 месяца назад +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  4 месяца назад +6

      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 4 месяца назад

      ​@@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?

    • @LouisDeconinck
      @LouisDeconinck 27 дней назад

      ​@@andfanilo I would love a video on this topic.

  • @larrysonjoelrakotonarivo3802
    @larrysonjoelrakotonarivo3802 4 месяца назад

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

  • @dhmkkk
    @dhmkkk 3 месяца назад

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

    • @andfanilo
      @andfanilo  3 месяца назад

      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 3 месяца назад

      @@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  3 месяца назад +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 RUclips!

    • @dhmkkk
      @dhmkkk 3 месяца назад

      @@andfanilo great looking forward to it!!!

  • @sitrakaforler8696
    @sitrakaforler8696 28 дней назад

    hahaha bon après ils sont hnnêtes dessus mais en tout cas oui tu as raison Fanilo x)

    • @andfanilo
      @andfanilo  25 дней назад

      Ahah je suis totalement d'accord qu'ils le disent assez ouvertement, mais j'ai toujours un petit nombre d'individus qui veulent critiquer sans lire alors je me dis, autant les appâter avec cette vidéo x)

  • @Jasruler
    @Jasruler 2 дня назад

    Le Sserafim mentioned

    • @andfanilo
      @andfanilo  День назад

      👀 and maybe it's not the only video with a mention...