4 Streamlit Alternatives for Building Python Data Apps
Tags: python, datascience, programming
Published: 2023-02-08 15:28:45

[Streamlit](https://streamlit.io/) is a library for turning Python scripts into shareable web applications. Streamlit apps are designed for the data science and machine learning community and make it easy to build dashboards and interactive ML models. What makes Streamlit so popular is its simplicity. Using the Streamlit library is quick and intuitive, which means you can create data apps without needing any web development experience. 

![An example Streamlit application showing data on New York City Uber pickups](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8yl2pzpf2135renb0emh.png)

While Streamlit is a great tool, it can fall short depending on your use case. The layout and styling of Streamlit apps is pretty rigid, so unless you're willing to write some HTML, JS and CSS, all your apps will pretty much look the same. Streamlit also has [speed issues](https://medium.com/@ramiromedina/like-streamlit-but-fast-enabling-low-latency-data-apps-948b95b098a2) becuase it reruns the Python script serving the app after every interaction on the frontend. 

While Streamlit claims "instant deployment", this isn't quite true. Although [deploying an app on Streamlit Cloud](https://docs.streamlit.io/streamlit-cloud/get-started/deploy-an-app) isn't difficult, it takes [several minutes](https://docs.streamlit.io/streamlit-cloud/get-started/deploy-an-app#watch-your-app-launch) each time you deploy a new change -- and that's not counting the time it takes the first time to connect up GitHub and Streamlit Cloud.

If you're looking for an alternative to Streamlit, you have some options. In this article, we’ll be taking a look at four different alternatives:

1. [Gradio](#1-gradio): a Python library for building machine learning demos 
2. [Plotly Dash](#2-plotly-dash): a low-code framework for building data apps with the Plotly plotting library in Python, R or Julia
3. [Panel](#3-panel): a Python library for creating flexible dashboards and web apps
4. [Anvil](#4-anvil): a platform for building full-stack web apps in Python

## TL;DR

Don't have the time? Skip the details of each alternative, and [go straight to the summary](#summary).

## 1. Gradio

[Gradio](https://gradio.app/) is probably the most similar alternative to Streamlit on this list. Like Streamlit, Gradio is a Python library for turning datasets and machine learning models into interactive web UIs. The main difference is that Gradio is designed more for machine learning demos whereas Streamlit is designed for creating data dashboards.

<figure>
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ga5itckzt57ub5j7s24s.png)
  <figcaption>An example Gradio application. Find it [here](https://colab.research.google.com/drive/12dowmDMfc6R64fAnua0ocGraHCm_jzIo?usp=sharing).</figcaption>
</figure>

### Pros:
* **East to use ML Models**: Gradio is now part of [Hugging Face](https://huggingface.co/), and the Hugging Face integration makes it sleek and simple to load ML models and datasets.
* **Easy to share your apps**: It's easy to share your apps. You can quickly generate a link to send to other users, but this link expires after 72 hours and runs all the code on your own machine. To share your app, you'll need to host it someplace else, like [Hugging Face Spaces](https://huggingface.co/spaces).
* **Embed in notebooks**: Gradio can be embedded in a Python notebook. This makes it easy to share and interact with code. 

### Cons:
* **Dated appearance**: Gradio apps have a very basic and dated look. It is possible to customize them, but you'll need to know how to write some CSS
* **Out-of-the-box cloud hosting options are limited**: The simplest way to host your Gradio app is on Hugging Face Spaces, but apps hosted on Spaces are very clearly hosted within the Hugging Face website, which makes it hard to brand your app for yourself or your company. 
* **Not standalone apps**: Gradio apps work best when embedded in another webpage, unlike Streamlit apps which work well as standalone apps.

## 2. Plotly Dash

Plotly is a plotting library, and [Dash](https://dash.plotly.com/) is their open-source framework for building data apps with Python, R or Julia. (Dash also has an [Enterprise version](https://plotly.com/dash/), but we'll focus on the open-source library here.)

<figure>
![Screenshot of a Plotly Dash app showing data on NYC Uber pickups](https://anvil.works/articles/img/streamlit-alternatives/dash-example.png)
  <figcaption>An example Dash Enterprise application. Find it [here](https://dash.gallery/dash-uber-rides-demo/).</figcaption>
</figure>


### Pros:
* **Faster than Streamlit**: Dash only needs to run the functions that are called while interacting with the app. With Streamlit, the entire script is re-run with every interaction.
* **Work in Jupyter notebooks**: If you prefer working in a Jupyter notebook, the [`jupyter-dash`](https://pypi.org/project/jupyter-dash/) library lets you run your dashboards within a Jupyter notebook.
* **More flexible design**: If you know some HTML and CSS, you can more easily style your Dash apps how you want.
* **Not limited to Python**: Dash is also a framework for R and Julia, so you are not limited to building apps in Python.


### Cons:
* **Limited layout options without HTML**: Dash has a Python wrapper around HTML for building UIs, but you still need an understanding of HTML in order to use it.
* **Larger learning curve**: Dash is a bit more complicated than Streamlit (you'll need to use ["callbacks"](https://dash.plotly.com/basic-callbacks) and some HTML, for example), so it isn't as easy to get started with.
* **Mostly Limited to Plotly**: Dash is a Plotly product, so the framework is designed to work with that plotting library. Technically, you can use Dash with other plotting libraries but not as easily and smoothly as Plotly.

## 3. Panel

Like the previous three alternatives, [Panel](https://panel.holoviz.org/) is an open-source Python library for creating interactive dashboard web apps. Panel is extremely flexible, allowing you to use any plotting library you like. Like Gradio but unlike Streamlit, you can use Panel in Jupyter notebooks. Panel dashboards can also be deployed as standalone web apps, but like Plotly Dash, you'll need to set up a server to deploy it yourself.

<figure>
![Screenshot of a Panel app showing data on NYC taxi rides](https://anvil.works/articles/img/streamlit-alternatives/panel-example.png)
  <figcaption>An example Panel application. Find it [here](https://nyc-taxi.pyviz.demo.anaconda.com/dashboard).</figcaption>
</figure> 


### Pros:
* **Work in Jupyter notebooks**: Panel integrates well with Jupyter notebooks, if that's how you prefer to write code.
* **Faster UI**: Unlike Streamlit, Panel does not re-run the entire Python script with every interaction, which means the UI can update much faster.
* **Use any plotting library**: Panel is also not tied to any specific plotting library (but Streamlit includes integrations with all of the most popular Python plotting libraries).
* **Start with a template**: Panel has some templates to start with. Although they are not very modern, they make it easier to vary the look of apps than Streamlit does.

### Cons:
* **Dated appearance**: By default, Panel apps look extremely boring and dated even when using a template. Changing the styling of Panel apps requires writing CSS.
* **Larger learning curve**: Panel is not as simple and intuitive as Streamlit is when building more complex apps.
* **Small community**: Panel has a smaller community, which means it can be harder to discuss and get help with using the library.
* **No out-of-the-box cloud hosting option**: Like all of the options here, Panel makes it easy to run and host your apps locally, but if you want to deploy them to the cloud, you're on your own. They do provide a guide on [different deployment options](https://panel.holoviz.org/user_guide/Server_Deployment.html).

## 4. Anvil

[Anvil](https://anvil.works?utm_source=crosspost:dev.to:/articles/4-alternatives-streamlit) is not a Python library like the other alternatives, but an entire IDE for building and deploying full-stack Python web applications. Anvil has a drag-and-drop page designer, which makes it much easier to layout and style the UI of your apps than any other alternative on the list. Because Anvil is more than just a Python library, it has more bells and whistles than the other options, such as a built-in database, user authentication, version control and cloud hosting that takes a matter of seconds to set up. All of this also means that it can have a bit more of a learning curve than the other alternatives.

<figure>
![Screenshot of an Anvil app showing data on NYC Uber rides](https://anvil.works/articles/img/streamlit-alternatives/anvil-example.png)
  <figcaption>An example Anvil application. Find it [here](https://uber-pickups-example.anvil.app/).</figcaption>
</figure> 


### Pros:
* **Deploy apps to the cloud instantly**: Anvil has truly instant cloud deployment. After just two clicks and no waiting time, your app is deployed. Basic hosting is free, including private apps. On paid plans, you can also have multiple development environments and add your own custom domains.
* **Design the layout**: The drag-and-drop UI designer makes it easier to layout and style unique dashboards without CSS and HTML (although you can use them if you want).
* **Connect to a built-in database**: The [built-in database](https://anvil.works/docs/data-tables?utm_source=crosspost:dev.to:/articles/4-alternatives-streamlit) means you can store, query and edit data all with Python. Anvil also has [file storage](https://anvil.works/docs/working-with-files/data-files?utm_source=crosspost:dev.to:/articles/4-alternatives-streamlit) for connecting CSV datasets, ML models and other large files.
* **Plotly is built in**: The [built-in Plotly integration](https://anvil.works/docs/client/components/plots?utm_source=crosspost:dev.to:/articles/4-alternatives-streamlit) makes it easy to build dashboards.

### Cons:
* **Larger learning curve**: Anvil has more of a learning curve than the other alternatives, which are just Python libraries.
* **Some features require a paid plan**: The Plotly integration is available for free, but if you want to install other Python libraries such as Pandas or Matplotlib, you'll need a paid plan (starting at $15/mo, with a free trial).

---

## Summary

* **[Streamlit](https://streamlit.io/)**
  - **Strengths**: Quick to learn, easy for simple internal-facing or personal projects
  - **Weakness**: Can be slow to run and deploy, limited in features and flexibility
* **[Gradio](https://gradio.app/)**
  - **Strengths**: Easily connect to HuggingFace packages
  - **Weaknesses**: Doesn't work well as a standalone app, limited in features and flexibility, basic and dated appearance
* **[Plotly Dash](https://dash.plotly.com/)**
  - **Strengths**: Apps are fast, work from a Jupyter notebook, can use R or Julia
  - **Weaknesses**: Larger learning curve, need to know some HTML to layout apps
* **[Panel](https://panel.holoviz.org/)**
  - **Strengths**: Use any plotting or visualisation library no matter how niche, work from a Jupyter notebook
  - **Weaknesses**: Basic and dated appearance, larger learning curve, no out-of-the-box cloud hosting
* **[Anvil](https://anvil.works?utm_source=crosspost:dev.to:/articles/4-alternatives-streamlit)**
  - **Strengths**: Out-of-the-box instant cloud hosting , drag-and-drop UI builder, more features for complex apps
  - **Weaknesses**: Larger learning curve, not all features are available for free

## Conclusion
Streamlit is a great tool for turning a Python script into an interactive web application. But it's not your only option for building Python data apps. [Gradio](https://gradio.app/) is a good tool for ML-focused apps, especially if you want to embed them in a Jupyter Notebook. For building dashboards, [Plotly Dash](https://plotly.com/dash/) gives you more flexibility over the layout of your app, while [Panel](https://panel.holoviz.org/) is the best option for using more niche plotting libraries. But if you're looking to build more complex apps and want to have control over their layout and design, then [Anvil](https://anvil.works?utm_source=crosspost:dev.to:/articles/4-alternatives-streamlit) comes out on top.