Data Science Conference
Options for Building Python Web Apps
By: Gordon Fleetwood – ODSC data science team contributor
One of the ways that R’s ecosystem outperforms Python’s with regard to Data Science is the existence of Shiny. It is the premier platform for data-driven web apps in the field. Shiny is already mature and is evolving steadily as seen at the recent inaugural iteration of the Shiny Developers Conference.
One speaker at the event was Joe Cheng, CTO of RStudio, the company behind Shiny. He will also be speaking at upcoming Open Data Science Workshops, ODSC East at the end of May. In the Python sphere, there is no Shiny equivalent. Instead, users have to leverage other frameworks and integrate aspect of data analysis into them.
The most preferred option is to use one of Python’s web frameworks. Django and Flask are the most popular options. The latter is generally preferred due to its lightweight nature, modularity, and ease of use. On the other hand, Django requires a lot of boilerplate material to construct even simple apps, and the underlying components are not as customizable as with Flask.
Using established web frameworks is a consequence of Python’s origins as a general purpose language rather than one built for data analysis. As Python has become an entrenched part of Data Science, there have been attempts to construct a Python equivalent to Shiny. One of these is Adam Hajari’s spyre, built on top of the Python web framework cherrypy.
The influence of Shiny is obvious in spyre’s structure, where the use of input and outputs ids to control the flow of objects from the backend to the front end was replicated. Mr. Hajari’s work has gained enough attention that he has spoken about it at conferences, but the library hasn’t been adopted by the Python community.
Another option which is very much in the early stage of development is Jupyter notebook extensions. Both the declarative widgets and dashboards extensions allow for a web app or dashboard to be constructed inside a Jupyter notebook, downloaded, and then deployed.
As the situation stands, all Python users have at the moment are shadows of what Shiny is capable of. When or if such a platform finally arrives, it will be another monumental step for Python in its use for Data Science.
Find this blog useful?
Help others find it by commenting and sharing.
This blog was originally posted at https://opendatascienceconferenceblog.wordpress.com/2016/04/27/options-for-building-python-web-apps/