Streamlit

Today is #TechnicalTuesday ๐Ÿค“!

Let's talk about practical technologies that you can use today.

In this thread, I will tell you about @streamlit ๐Ÿงต๐Ÿ‘‡


๐Ÿ’ก Streamlit is a Python framework to make data science apps blazingly fast.

The core value proposition is that you don't need any HTML, CSS or JavaScript, just pure Python. Take a look:


โ“ Why do you want this?

As a data scientist, you spend most of your time designing, experimenting and testing models. You probably use Jupyter Notebooks a lot, right?

What happens when you have to show those models working?


If you're working for another data scientist, you can probably just share your Python scripts or Notebooks, but at some point in the chain, someone who doesn't ready code will need to see your model in action.


At this point, you (or someone) has to build a minimal application, an MVP, that at least shows some input controls, allows you to play with some model parameters, and lets you render some graphs.


This often takes the form of a Flask application with a minimal HTML frontend, possibly with a minimum JavaScript. And don't forget CSS.

โ“ The question is, who builds this MVP?


๐Ÿ‘‰ We the data scientists either don't have the skills or we have to spend a ridiculous amount of time dealing with frontend details we couldn't care less (since this is not a product, it's just a demo).


๐Ÿ‘‰ The frontend team is usually busy with, you know, building the real product, and it's ineficient to use their time for building this app which, again, is not the final product.

๐Ÿคท But someone has to do it.


Enter @streamlit. The frontend framework for pragmatic data scientists.

๐Ÿ‘ Forget about writing any HTML, CSS or JavaScript. Everything is pure Python code, and you get a nice reactive for free.


๐Ÿ‘ Forget about routes, templates, sessions and global state. Your code looks exactly like a Python script because it is a Python script. Everything is executed top-to-bottom every time the user changes something.


๐Ÿ‘ And you get a super powerful caching mechanism as a simple Python decorator that you can use in any heavy method (e.g., downloading data, training a model). So forget about having to manually store all that data.


There is one main caveat:

โš ๏ธ You have very little customization for layouts or styling.

But you don't care about that, remember, this is not the final product, is just a demo to showcase some prototype model.


If you're like me, you just want to have a frontend to show today with the least possible throw-away effort.

โญ Take @streamlit for a spin today. I promise it'll be worth it.


As usual, if you like this topic, reply in this thread or @ me at any time. Feel free to โค๏ธ like and ๐Ÿ” retweet if you think someone else could benefit from knowing this stuff.

๐Ÿงต Read this thread online at https://apiad.net/tweetstorms/technicaltuesday-streamlit


Stay curious ๐Ÿ––


๐Ÿ—จ๏ธ You can see this tweetstorm as originally posted in this Twitter thread.