anywidget.dev
Anywidget is a standard for building reusable interactive widgets, presented as going beyond frameworks. It is installed with pip, and its documented example defines a counter widget in Python using anywidget and traitlets, with rendering code written in JavaScript.