6 ms·
Show HN: Mercury – Publish Jupyter Notebook as web app by adding YAML header
Mercury is a perfect tool to share your Python notebooks with non-programmers.
- You can turn your notebook into web app.
- You can add interactive widgets to your notebook by defining the YAML header. Your users can change the input and execute the notebook.
- You can hide your code to not scare your (non-coding) collaborators.
- Users can interact with notebook and save they results.
- You can share notebook as a web app with multiple users - they don't overwrite original notebook.
The demo running at Heroku (free dyno) http://mercury-demo-1.herokuapp.com http://mercury-demo-1.herokuapp.com, at AWS EC2 (t3a.small) http://mercury.mljar.com http://mercury.mljar.com - No need to register.
- sankao 5y agoWhy yaml? The web already has a markup language.
- hjjooesc 5y agoThis is bike shedding. The nuances of which principles to use to convert notebooks to standalone apps are complex with unexpected trade-off, so instead you prefer to focus on the borderline inconsequential point of the format.
- pplonski86 5y agoMercury was inspired by R Markdown where YAML is used. I think that YAML is quite easy way to quickly define simple User Interface.
- phillc73 5y agoThis is also similar to the header formatting for Weave.jl, markdown for Julia.[1] This is probably also inspired by R markdown, but I mention it because it seems to be a reasonably common practice in tools for the data science field. [1] http://weavejl.mpastell.com/stable/header/#Header-Configuration http://weavejl.mpastell.com/stable/header/#Header-Configurat...
- tmabraham 5y agoHow is this better than Voila, which is developed by the Jupyter Notebook team? https://github.com/voila-dashboards/voila https://github.com/voila-dashboards/voila
- pplonski86 5y agoMercury has different architecture. Is it better? Hard to say, users will tell. When building Mercury I was inspired by R Markdown YAML. Voila is using tornado, and for each user it is creating a python kernel. User can interact with notebook code with widgets (ipywidgets) created inside the notebook. Voila can serve one notebook at the time. Mercury is built on Django+Celery. Widgets are defined outside the notebook with YAML. All executions are processed in the background. There can be served several different notebooks in the same time. The notebooks gallery is built-in. In Mercury, it will be easy to add more options for notebooks execution. I'm planning to add notebook scheduling and option to convert notebook into REST API.
- pplonski86 5y agoHi, creator here. Mercury is an easy way to convert notebooks into interactive web apps, where user can tweak input parameters by widgets and click RUN button to execute notebook with new input. User can also download the executed notebook. Mercury is open-source with AGPLv3 license. For companies looking for more features, commercial friendly license and dedicated support I'm planning to offer paid license (I hope it will give long live to the project). In the near future I would like to add: - notebooks scheduling (with email notifications) - option to convert notebook to REST API (with YAML config) I hope Mercury will be an easy tool for all notebook users and will help them to share their results with non-programmers.
- phillc73 5y agoLooks really interesting. I tried Voila a while ago and struggled to really get it to do what I wanted. This was a year ago though, so maybe things have improved. Does Mercury support all Jupyter kernels or only Python? Also, how do I deploy this myself? Maybe I just missed it as I was viewing on my phone, but I couldn’t find any documentation. Edit: Oops, missed the GitHub page and only looked at the demo links. Some of my “docs” question is answered there. Still curious about supported kernels though.
- pplonski86 5y agoRight now, it works with only Python, but can be extended to any kernel. Deployment should be easy, I wrote guides how it can be done on Heroku and AWS EC2 https://github.com/mljar/mercury/wiki https://github.com/mljar/mercury/wiki
- polotics 5y agoHi Cool tool. One question: with Yaml being used to fill in the possible choice of a selection-box, how do I make the choices dynamic?
- pplonski86 5y agoYou can't dynamically set values in widgets. All values (choices and ranges) should be set upfront.
- polotics 5y agoOk, still could be useful, as indeed the one kernel per session design of alternatives like AppMode or Voilà is a bit limiting. While you're here: how do I best display a pandas dataframe with Mercury?
- pplonski86 5y agoThe same was as you display in Jupyter. Just exectue the cell with your data frame variable. The alternative might be to use rich package (https://github.com/Textualize/rich https://github.com/Textualize/rich) but I don't have a tutorial yet.
- deleted 5y ago[deleted]