imapquota.py is a Python script that checks the space remaining in an IMAP mail account using imaplib.

$ imapquota -s imap.mail.drexel.edu xyz12@drexel.edu
Password:
Used 92693 of 102400 KB
90.5 percent