sankey-layout
Sankey diagram layout algorithm written in Javascript, intended for use with d3. See d3-sankey-diagram if you just want to draw Sankey diagrams; this package contains the layout algorithms but no visualisation.
If you use the Jupyter notebook, try ipysankeywidget.