transforms any gmail address into its simplest, canonical form.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

When evaluating the addresses of incoming mail, Gmail servers...

  • Are case insensitive
  • Ignore periods
  • Ignore any text after a plus sign

Additionally, and can be used interchangeably.

So... == == ==

All of these variables make it difficult to check a given email address for uniqueness.

The normalize(email) method in transforms any email address on a Gmail server, including Google Apps addresses with custom domains, to its simplest, canonical representation
(E.g., becomes so that it can be compared against other canonical addresses.


>>> from canonical_gmail import normalize 
>>> normalize('') #Gmail address
>>> normalize('') #Googlemail address
>>> normalize('') #Google Apps custom domain address
>>> normalize('') #Non-Gmail address

The canonical address should not be stored in lieu of the user's inputed address, as some folks use these modifications to route their incoming email to particular folders.These Gmail power users can be a persnickety bunch. Don't mess up their system.

DEPENDENCY: (or 'pip install dnspython')