ggmail

Manage gmail account using python, forget about imap and just code what you supposed to do.


Keywords
python, library, simple, imap, human, pydantic
License
MIT
Install
pip install ggmail==0.3.1

Documentation

GGmail

GGmail Continuous Integration codecov PyPI version downloads versions License: MIT

Manage mail account using python, forget about imap and just code what you supposed to do.

Help

See documentation for more details.

Install

Install using pip install ggmail.

A Simple Example

from ggmail import Account, Google
from ggmail.policy import from_contains, flagged

authentication = Google(username="ggmail@gmail.com", password="secret")
with Account(authentication=authentication) as account:
    inbox = account.inbox()
    mailbox = account.create_mailbox("Favorite")
    policy = from_contains("from@gmail.com") + flagged
    messages = inbox.search(policy)

    for message in messages:
        message.copy(mailbox)

Additional Information

Why not use imbox instead ?

https://github.com/martinrusev/imbox is less high level than ggmail. I wanted something even more human than imbox.

Why not use gmail instead ?

https://github.com/charlierguo/gmail seems to be dead.

You don't support my mail provider ?

You can raise an issue and I will add it.