EDIT : I wrote a little Python script for fun. It seems to work pretty well :
Or you can still try with :
There is a Node.js library which solves exactly your problem: https://github.com/remy/inliner/ It can be used both as a commandline script and a library.
It will make you a single
.html file which can be sent anywhere by any means and be opened later in any browser without the need in Internet connection.
This Python project of mine can help with getting the CSS styles inline https://github.com/rennat/pynliner
©2020 All rights reserved.