Napari Hub Lite - napari.org/hub-lite
This implementation of the napari hub is developed and managed by the napari team. It is based on an original implementation by Yunha Lee.
The website is deployed daily using GitHub pages and contains plugin information served by npe2api. This GitHub repository contains the Python scripts, javascript, HTML templates and CSS templates required to build the web pages.
The site is a static build with a small Python-based generator.
build_site.pyorchestrates the local build, copies shared assets into_build/, and runs the data and HTML generation steps.fetch_napari_data.pyfetches plugin data from npe2api for plugin information including PyPI/conda info and individual plugin manifests, then writes build data into_build/data/.create_static_html_files.pyreads_build/data/plugin_page_data.jsonand generates:_build/plugins/*.htmlfor individual plugin pages_build/plugins_list.htmlfor the homepage plugin list
index.htmlis the homepage shell andstatic/js/plugin_loading_and_search.jsloads the generated plugin list and client-side search behavior..github/workflows/build_and_deploy.ymlrunspixi run alland publishes_build/to GitHub Pages.
The key implementation surfaces are:
fetch_napari_data.py: external data fetching and normalizationcreate_static_html_files.py: HTML generation and markdown renderingtemplates/each_plugin_template.html: plugin detail page templateindex.html: homepage structurestatic/js/plugin_loading_and_search.js: homepage interactivitystatic/css/: copied styling assets used by the generated pages
To build the website locally:
# install pixi if you don't have it already
pixi run allor to serve the site locally in your browser:
pixi run liveAll tasks are available through build_site.py and can be run with pixi or uv. The tasks are:
clean: deletes the_build/directory and everything inside it, so use with caution. This is the first step in a full build, but you can also run it separately if you want to start from a clean slate.prep: copies static assets into_build/and prepares the build environment, but does not run the data fetching or HTML generation steps, so it is fast to run and can be used beforefetch-dataorhtmlfor iterative development.fetch-data: runs the data fetching step, which can be slow due to the number of plugins and API calls, but is only needed when plugin data changes.html: runs the data fetching and HTML generation steps, but does not clean or copy static assets, so it is faster for iterative development.
Pixi is the easiest cross-platform way to build the site locally.
Useful tasks:
pixi run cleanpixi run preppixi run fetch-datapixi run htmlpixi run allpixi run live
If you prefer a Python-native workflow without Pixi, use uv against the same
pyproject.toml manifest. The underlying Python scripts are the same as with Pixi. E.g.
uv run python build_site.py alluv run python build_site.py live
This project makes extensive use of the design and html resources from the original napari hub. All resources are used with permission.
