Skip to content

Quick Start

Mercury detects all Python notebooks available in the current directory and serve them as web apps. Please run the following command to start server:

Start Mercury Server
mercury

It should open a web page at localhost:8888 with information that no notebooks found if there are no notebooks (*.ipynb files) in the current directory you should see

Mercury with no notebooks

Let’s create a first notebook with TextInput widget. The notebook will ask for user name and display welcome message.

# first cell with imports
from mercury import TextInput
# create interactive widget
name = TextInput(label="What is yout name?")
# display widget value
print(f"Hey {name.value}!")

In MLJAR Studio or JupyterLab editor please click on confetti icon in the top toolbar to open a live app preview.

Mercury with no notebooks

Start a server with command:

Terminal window
mercury

You should see a card with notebook. The title in the card will be the same as notebook filename.

Mercury serving one notebook Mercury with no notebooks