Most up-to-date notes and the Python script can be found in this notebook. If you want to contribute, please shoot me a message and/or send a pull request on Github. The case of min-cross-entropy distributions is covered as well.