I think for a lot of cases people don't want to get stuff running on a server and it's too big a hassle for some to run it locally. So i was thinking, given the popularity of electron, whether it would be possible to create a standalone app that reads and publishes sth like dash-books. Guess this could be really powerful (kind of an alternative to tableau etc.). I might have a go at it if you can point me into the right direction.
Hey @adrianoesch - Yeah, this is a great idea. The main difficulty in doing this is managing the cross-platform python installation and dependencies. Electron makes it easy by packing everything up, as far as I'm aware, there isn't a solution that makes this as easy in Python.
Now, if the user _does_ have python installed, then I presume that some type of "dash-reader" could use that dist of python, create a virtual env, and automatically install dependencies, and then run the app.
Or, we could leave installing the dependencies entirely up to the user. A Dash Viewer App could just make Dash files "double-clickable" - double clicking on a dash app file (.py? or a new file extension like .dash?) would open run the app automatically using the configured version of python and open that app in an electron window. This is sort of like what nteract does with jupyter notebooks.
Another future to imagine is entirely standalone Dash apps that don't use any python callbacks - basic interactivity between components is defined through a JSON spec and entirely self-contained within an HTML file. These apps would be very easily distributable. See https://github.com/plotly/dash-renderer/pull/7 for a POC
Thanks for your interest. I'll have a deeper look into you answer later. I found this in the meantime, looks promising.
It's possible the BeeWare project could be useful. In particular, Briefcase, for packaging the app for multiple OS targets.
https://code.fb.com/data-infrastructure/xars-a-more-efficient-open-source-system-for-self-contained-executables/ could be of use here? See discussion on Hacker News: https://news.ycombinator.com/item?id=17524086
@adrianoesch Hey, curious if you were able to make any progress in this area? I am interested in doing the same thing. The flask desktop project you linked to a year ago looks promising although I dont know if it will play nicely with dash or not but I am going to give it a go.
@chriddyp
Electron makes it easy by packing everything up, as far as I'm aware, there isn't a solution that makes this as easy in Python.
pipenv environments seem to include all dependencies in the virtual environment folder including python itself. It would be a bit bulky, but I feel like it should be possible to use that to bundle all the python requirements.
@befeltingu have a look at pywebview (https://github.com/r0x0r/pywebview). i played around a bit with it, seems to be a good desktop solution for flask/dash integration but you still have to ship everything in binaries. but this should not be too difficult either... (check the post from nicolas further up)
@adrianoesch Thanks for the link that looks promising I will have a look. I have been looking at (https://github.com/smoqadam/PyFladesk) myself. It opens your Flask app in a Qwebview instead of using your browser.
You could use Pywebview for a Cross platform Desktop App. It uses native Windows on every platform with a Web view inside and serves the App inside this Window.
https://github.com/r0x0r/pywebview/blob/master/README.md
Remi is using this as well to serve WebApps as Desktop Apps locally if you start the server with the standalone flag.
@adrianoesch what was your final solution? PyFladesk? Everything worked fine?
Hi guys! Since there is no answer from OP for a year, I can tell you that PyFladesk works like a charm for me. To use with dash you have to replace init_gui(app) with init_gui(app.server).
I still had a problem with packaging application to exe with cx_Freeze (the app crashed), but if you don't want to do this, it should work.
Hi guys! Since there is no answer from OP for a year, I can tell you that PyFladesk works like a charm for me. To use with dash you have to replace init_gui(app) with init_gui(app.server).
I still had a problem with packaging application to exe with cx_Freeze (the app crashed), but if you don't want to do this, it should work.
Hi there, so if I want to use it in a computer with no python it is not working, isn麓t it?
Most helpful comment
Hi guys! Since there is no answer from OP for a year, I can tell you that PyFladesk works like a charm for me. To use with dash you have to replace init_gui(app) with init_gui(app.server).
I still had a problem with packaging application to exe with cx_Freeze (the app crashed), but if you don't want to do this, it should work.