Python dashboards after Shiny for Python

After building a demo in Shiny for Python I decided to see how to build a demo dashboard with the other tools available for Python, namely Streamlit and Dash.

The good thing about doing all these in Python is that so much of the code can be reused. Both repositories are packaged as a python package, but it seems there are some limitations in how that can be used, especially in the Streamlit app. However, I am not too familiar with the python way of doing things, so I may be missing some obvious stuff.

First, I built the Streamlit app. This was really easy. Everything about Streamlit is really friendly and I had no problems finding what I needed in the documentation. I was surprised that I was able to recreate the app in about 20 lines of code, half of what the shiny app is (not counting the functions that reside in a separate file).

The experience with Dash was a bit more involved. The structure of the code resembles shiny in the sense there are separate blocks for UI and Server (or callback as it’s called in Dash). In terms of lines of code Shiny and Dash are the same – at least for this demo. For the Dash app, I spent too much time to find out how to render a simple table. I generally found the experience of going through Dash docs a little bit confusing when compared both to Shiny and Streamlit.

I don’t have any takeaways except that it was fun doing this. The code for both demos is on github (Streamlit, Dash).

Novica Nakov
Novica Nakov

Data Wrangler.