Calibre and DeDRM are the apps you're looking for; DeDRM doesn't include the decryption keys, you'll need to supply your Kindle's serial number or extract the keys from an old version of the Kindle app.
Yeah I did this with all the kindle books I ever bought before switching to a Kobo. Just need to try and get my partner out of the Amazon ecosystem now.