Extending Lumen¶
Lumen's core building blocks—Sources, Agents, Tools, and Analyses—are all subclassable Python classes. If you've built a custom component and want to share it as a reusable, installable Python package, the Panel Extension Copier Template gives you a fully configured project scaffold to do just that.
What is the Panel Extension Copier Template?¶
The copier-template-panel-extension is a Copier template that scaffolds a fully configured Python package for Panel and Lumen extensions. It gives you:
- pytest for testing
- Zensical + mkdocstrings for automatic API docs hosted on GitHub Pages
- GitHub Actions CI/CD for automated testing and publishing
- Pixi for reproducible environment management
Quickstart¶
Make sure you have Pixi installed, then run:
pixi exec --spec copier --spec ruamel.yaml -- \
copier copy --trust \
https://github.com/panel-extensions/copier-template-panel-extension \
lumen-name-of-extension
You'll be prompted for a few details such as extension type, project slug, and author info. Choose Lumen as the extension type when asked, and select py311 or higher for the minimum Python version—Lumen requires Python 3.11+.
From there, follow the template's step-by-step guide to set up GitHub Pages docs, link to PyPI, and publish your first release with a git tag.
Further Reading¶
- Data Sources — built-in sources and how to configure them
- Agents — customizing agent behavior
- Tools — adding domain-specific tools
- Analyses — deterministic analysis functions
- Panel Extension Copier Template on GitHub