Skip to main content

Weed out disposable email providers with ease

Project description

disposable-emails

Weed out disposable email providers with ease 🚀

Installation

You can install this package using PyPI:

pip3 install disposable-emails

There are no dependencies. You don't need Django, Flask or any third-party API.

How to use

Check an email:

>>> from disposable_emails import is_disposable_email
>>> is_disposable_email('john.smith@mailforspam.com')
True
>>> is_disposable_email('john.smith@gmail.com')
False

Check a domain:

>>> from disposable_emails import is_disposable_domain
>>> is_disposable_domain('temp-mail.com')
True
>>> is_disposable_domain('kremlin.ru')
False

Using Django? There is a form validator which you can use with forms:

from django import forms
from disposable_emails.contrib.django import disposable_validator

class FooForm(forms.Form):
    email = forms.EmailField(
        label="Email",
        max_length=254,
        validators=[disposable_validator]
    )

And with models:

from django import models
from disposable_emails.contrib.django import disposable_validator

class FooModel(models.Model):
    email = models.EmailField(validators=[disposable_validator])

Credits

This package uses disposable by @andreis as a source of disposable email services.

Contributions

Code contributions are welcome! Just drop a pull request.

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

disposable-emails-1.1.0.tar.gz (818.1 kB view details)

Uploaded Source

File details

Details for the file disposable-emails-1.1.0.tar.gz.

File metadata

  • Download URL: disposable-emails-1.1.0.tar.gz
  • Upload date:
  • Size: 818.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for disposable-emails-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3961a9b7c764ee2e2fc97b4671fbe92389e5d6ecfaf28a57792605412e374ed2
MD5 a13b106c2764a34b579a4d800a811c4b
BLAKE2b-256 9b30f89efba4108f5cbd5421c429c4d9a15f009ea51bbc2304000e7e0eb42321

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