Created this program to analyze my gmail. It connects via imap. Originally you could use just your gmail password but that has been disabled so you can create something called an app password if you don't use the API.
The way I'm using it right now is through IntelliJ and passing my email and app password CLI args.