Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

HireIQ/email-address-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

email-address-parser

Thanks to Rob Forman (https://github.com/robforman) and Ben Olive (https://github.com/sionide21) for helping come up with the general process for parsing.

Parse email addresses from an outlook-like "To:" field.

The nice thing about this parser is you could give it a ridiculously jacked up list of emails: no commas, no names, names and emails stuck together (no spaces), and it'll still parse that string and give you a pretty list back.

To use:

from eparser.parsers import email_address_parser

...

emails = email_address_parser.parse(some_email_list)

Alternatively, you can instantiate your own with a list of additional bad tokens you want stripped from names:

from eparser.parsers import EmailAddressParser 

parser = EmailAddressParser(bad_tokens=[";"])

emails = parser.parse(some_email_list)

String and Unicode representations are in the format: "Foo Bar" <foo@bar.com> If there is no name, it's just the email.