The field of Data Science and Analytics is rapidly growing, and one of the most important steps in the data science pipeline is model deployment. In Python, frameworks like Flask and Django are commonly used for this purpose. However, these options often require knowledge of technologies such as HTML, CSS, and JavaScript, which can be a hurdle for data scientists and machine learning engineers who prefer to focus on working with data and models.

To address this issue, Adrien Treuille, Thiago Teixeira, and Amanda Kelly created Streamlit, an open-source library specifically designed to simplify the creation and sharing of interactive web applications for machine learning and data science.

What is Streamlit?

Streamlit is a free and open-source framework designed to enable the quick and easy creation of impressive web applications for data science and machine learning. It was developed especially for engineers and data scientists who often lack experience or interest in web development.

With Streamlit, you can build beautiful and functional applications using just a few lines of Python code. This eliminates the need for weeks of studying or working with frontend tools, allowing developers to focus on what truly matters: data and models.

Why Should Data Scientists Use Streamlit?

Streamlit offers several advantages:

  • Ease of Use: No prior knowledge of frontend technologies (HTML, CSS, or JavaScript) is required.

  • Rapid Development: Web applications can be built in just a few hours or even minutes.

  • Integration with Popular Libraries: Compatible with libraries such as pandas, matplotlib, seaborn, plotly, Keras, PyTorch, and even SymPy (for LaTeX rendering).

  • Less Code, More Efficiency: Significantly reduces the amount of code needed to create applications.

  • Built-in Data Caching: Simplifies and accelerates complex computational pipelines.

Additionally, Streamlit allows you to create user-friendly and intuitive interfaces, which is essential for the success of any modern application. It is ideal for those who want to quickly transform their data science scripts into interactive applications that display data and collect necessary parameters for modeling.

What Will You Learn in This Tutorial?

In this article, we will:

  • Explore some important Streamlit functions.

  • Create a Python project.

  • Deploy the project on a local web server.

How to Install Streamlit

To get started, install Streamlit by running the following command in the terminal:

pip install streamlit

After installation, test whether Streamlit was installed correctly. Run the following Python code. If no error appears, the installation was successful, and you can start working with Streamlit.

How to Run a Streamlit File

Open the terminal or Anaconda shell and type the following command:

streamlit run filename.py

For example, if your file is named example.py, type:

streamlit run example.py

After running the command, a local URL will be displayed in the terminal. Open this URL in your browser to access your application.

With this information, you are now ready to take your first steps with Streamlit! In upcoming tutorials, we will explore more features and how to create interactive applications.