Eric J Ma's Website

Serving multiple Panel apps together

written by Eric J. Ma on 2019-12-26 | tags: data science dashboarding python


I learned a new thing today! If I have a bunch of small dashboard-like utilities, panel, which uses the bokeh server behind the scenes, can serve up multiple files together from the same server.

Here's an example. Assume I have the following directory structure:

|- /
  |- app1.py
  |- app2.py
  |- app3.py

If I start a Panel server here using:

panel serve *.py
# or, to be selective
panel serve src1.py src2.py src3.py

If you have a bunch of Jupyter notebooks, the analogous command is:

panel serve *.ipynb
# or, to be selective:
panel serve nb1.ipynb nb2.ipynb nb3.ipynb

Then all of the apps will be served up, with a default Bokeh landing page provided to link to each of the apps.

Doing so lets us build multiple little utilities that can help ourselves and our colleagues be more productive!

For an example of this, check out the minimal panel app I built to record these ideas. (Source code is available here.)


I send out a newsletter with tips and tools for data scientists. Come check it out at Substack.

If you would like to sponsor the coffee that goes into making my posts, please consider GitHub Sponsors!

Finally, I do free 30-minute GenAI strategy calls for organizations who are seeking guidance on how to best leverage this technology. Consider booking a call on Calendly if you're interested!