OpenSSL has a function to "SSL_export_keying_material" as described in RFC5705. This functionality is needed to be able to support a bunch of other protocols such as "Network Time Security for the Network Time Protocol" which has now become a proper RFC as RFC8915. There are half a dozen other RFCs which also use this functionality.
I have written a patch to add support for this function which can be found on github:
https://github.com/wingel/cpython
And it is used in my implementation of the NTS procotol which can also be found on github:
https://github.com/Netnod/nts-poc-python
It would be very nice if mainline Python could support for this function in the future so that I don't have to maintain a patched version of Python for this.