Skip to main content

Split an email address into its local and domain parts

Project description

Build Status

Split an email address into its local and domain parts

This was built to grab the name used off of an email address. This library does not perform validation as we retrieve our email addresses from a trusted source.

This was initially written in JavaScript and has been ported to Python.

Getting Started

Install the module with: pip install email_split

from email_split import email_split
email = email_split('todd@underdog.io')
email.local  # todd
email.domain  # underdog.io

Documentation

We export the function email_split from our module email_split.

email_split(email)

Function that extracts local and domain parts of email address.

  • email str - Email address to break down

Returns:

  • email object - Object representing email address

    • local str - Leading portion of email address

      • For example, todd in todd@underdog.io

    • domain str - Tailing portion of email address

      • For example, underdog.io in todd@underdog.io

We chose the names local and domain based off of the RFC specification for mailto.

https://tools.ietf.org/html/rfc5322#section-3.4.1

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test and lint via ./test.sh.

License

Copyright (c) 2016 Underdog.io

Licensed under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

email_split-1.0.0.zip (10.7 kB view details)

Uploaded Source

email_split-1.0.0.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file email_split-1.0.0.zip.

File metadata

  • Download URL: email_split-1.0.0.zip
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for email_split-1.0.0.zip
Algorithm Hash digest
SHA256 123256f631cac7045300d76788595377264e79bb6fa4e388d350820d2697fd46
MD5 63b7393ba7b6b721f6e2e746374f3b26
BLAKE2b-256 70dad46f7bfef68c053e2cd02dff7254b31e2e6b1ddfd3266b2584936b48de9b

See more details on using hashes here.

File details

Details for the file email_split-1.0.0.tar.gz.

File metadata

File hashes

Hashes for email_split-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1e9c571a70bd6a7849733c8e970013e7e38550f59d952332ab75e63792b6860b
MD5 5bdb02c07624dc8ed897f599e8f6d01a
BLAKE2b-256 981b7baab9165943f53d4888eb25d5f8e3f1d63622908e4e88c080e2cb3d29f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page