This is a test of mercury, which is a way to use Jupyter notebooks as semi-interactive dashboards. It could be useful at least for showcasing a small project, as the interface which it develops is split in half, with the left side containing parameters for the notebook and the right side displaying notebook contents, either hiding the cells and just showing outputs or including the cells as well.
git clone
this repository andcd
into it.- Install requirements in your virtual environment of choice (for me this meant
running
python -m venv .venv; source .venv/bin/activate; pip install -r requirements.txt
). - Confirm the notebook is working by running
jupyter notebook
and ensuring that all cells can run. Feel free to shut down the notebook, it does not have to be running for mercury to work. - Add the notebook to mercury with
mercury add iris-test.ipynb
. Note that mercury is sort of a page of dashboards where each dashboard corresponds to a notebook, so you can run more than one notebook. - Start the server with
mercury runserver --runworker
- Go to
http://127.0.0.1:8000
and click on the notebook to see that it works.
We are following the instructions from this tutorial Step 0 is to create a heroku account and install the CLI.
-
Clone this repository and
cd
into it. -
Run
heroku login
-
Run
heroku create APPNAME
where you fill in whateverAPPNAME
you want. -
Set heroku environment variables:
heroku config:set SERVE_STATIC=True heroku config:set ALLOWED_HOSTS=APPNAME.herokuapp.com heroku config:set NOTEBOOKS=iris-test.ipynb
-
run
git push heroku main
-
Start the app with
heroku ps:scale web=1
and confirm the app is working by runningheroku open
to open the app in a browser. -
Shut down the running app with
heroku ps:scale web=0
-
Destroy the app with
heroku apps:destroy APPNAME --confrim APPNAME
.
To view logs, run heroku logs --tail
.