I know how to use email.utils.parseaddr to parse an email address such as
"Foo" <bar@quack.com>
into the following 2-tuple:
('Foo', 'bar@quack.com')
.
I also know how to use the split() function to turn the address portion into this tuple:
('bar', 'quack.com')
.
But what I'm looking for a pre-existing module which contains a function which will parse that address into this 3-tuple:
('Foo', 'bar', 'quack.com')
.
I can trivially write such a function, and I have done so on numerous occasions. But what I'm looking for is an already-existing module that provides an already-defined function that will produce such a 3-tuple when given any email address.
I haven't been able to find such a thing. Can anyone point me to something like this which might already be in existence?