http://6i4b2igvvpe53lp4vpm4frtjvdepiyfczdemljgomn5mqjtfl2w7scyd.onion/tag/python
Gist contains many scripts to do so, and I tried one of them, but it did not work as I wanted. I wanted to download all the IMAP folders, not only Inbox. Therefore, I wrote my version of that script 😄️.