The library makes parsing and manipulation of URL🌐 and Email address📧 easy.
Project description
netcleanser
The library makes parsing and manipulation of URL🌐 and Email address📧 easy.
Install
pip install netcleanser
How to use
>>> from netcleanser import Email
>>> email = Email('shinichi.takayanagi@gmail.com')
>>> email.domain
'gmail.com'
>>> email.local_part
'shinichi.takayanagi'
>>> email.is_valid()
True
>>> email.value
'shinichi.takayanagi@gmail.com'
This Email
class is settable
and dictable
# As a dict key
>>> x = {email: 1}
>>> x[email]
1
# As elemtns of set
>>> email2 = Email("nakamichiworks@gmail.com")
>>> {email, email, email, email2, email2}
{Email(value='nakamichiworks@gmail.com)', Email(value='shinichi.takayanagi@gmail.com)'}
Email.build()
allows you to create dummy email address specifing the only part of local_part
or domain
>>> Email.build(local_part = "hoge")
Email(value='hoge@dummy.com)'
>>> Email.build(domain = "hoge.com")
Email(value='dummy@hoge.com)'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
netcleanser-0.1.1.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for netcleanser-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3970764ffc047891d26d227eba10f9caa59de9d08e13cc4cf7643b601fa20783 |
|
MD5 | afd8af80824313bc1e388bf7ff3ea829 |
|
BLAKE2b-256 | e0969a693017c0d7b937d84df653d9f381683ff0f7e42dc8e03f4d34e8426e13 |