Show HN: Mercury – Publish Jupyter Notebook as web app by adding YAML header (github.com)

61 points by pplonski86 ↗ HN
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, at AWS EC2 (t3a.small) http://mercury.mljar.com - No need to register.

14 comments

[ 3.1 ms ] story [ 36.1 ms ] thread
(comment deleted)
Why yaml? The web already has a markup language.
Mercury was inspired by R Markdown where YAML is used. I think that YAML is quite easy way to quickly define simple User Interface.
This 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.
How is this better than Voila, which is developed by the Jupyter Notebook team? https://github.com/voila-dashboards/voila
Mercury 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.

Hi, 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.

Looks 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.

Hi 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?
You can't dynamically set values in widgets. All values (choices and ranges) should be set upfront.
Ok, 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?
The 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) but I don't have a tutorial yet.