Behind the scenes, even pure Python widgets are composed of two pieces:
When writing your own widgets, that means making a choice: write only in Python or write in both Python and Javascript.
Which to choose depends on what you are trying to accomplish. This tutorial will focus on writing your own widgets in pure Python. An example of a pure-Python package that includes some interesting interfaces is reducer, a package for calibrating astronomical data.
What you can accomplish with just Python has increased quite a bit in the last year or two as more sophisticated tools that plug in to the Jupyter widget ecosystem have been written.
One of those tools is bqplot, which provides a plotting tools in which the plot, and the lines, markers, labels and legend, all act as widgets. That required both Python and javascript. On the javacsript side bqplot uses d3 to do the drawing in the browser.
Another example is ipyvolume, which does three-dimensional renderings of point or volumetric data in the browser. It has both Python and javascript pieces.
One last addition is in ipywidgets
itself: the new Output
widget can display any content which can be rendered in a Jupyter notebook. That means that anything you can show in a notebook you can include in a widget using only Python.