I have an assignment to use ipywidgets and the inputs value.value, convertFrom.value, and convertTo.value in Jupyter to convert any unit into another unit without building an "internal two-dimensional table structure of the conversion of every unit to every other unit for every category". We are supposed to "find a common, base unit (e.g., meters for distances) and then just store the constant (e.g., 1000 for kilometers) that is used to convert from the base unit to that unit. To convert from two units in the same category (neither of which are the base unit), you simply convert from your convertFrom unit to the base unit, then from that to the convertTo unit."
I have initial code that generates input widgets. I attached an image of that code here.