Skip to main content

Check if an email address or domain belongs to a disposable/temporary email service. Bundles 72k+ domains from disposable/disposable-email-domains.

Project description

python-disposable

A Python package to check if an email address or domain belongs to a disposable/temporary email service.

Bundles 72,000+ domains from disposable/disposable-email-domains, updated daily.

Installation

pip install disposable-email-check

Usage

from disposable_email import is_disposable, is_valid, domain_count

# Check by email address
is_disposable("user@mailinator.com")  # True
is_disposable("user@gmail.com")       # False

# Check by domain only
is_disposable("guerrillamail.com")    # True

# Inverse check
is_valid("user@gmail.com")            # True
is_valid("user@10minutemail.com")     # False

# How many domains are bundled?
domain_count()  # 72170

Django example

from django import forms
from disposable_email import is_disposable

class RegisterForm(forms.Form):
    email = forms.EmailField()

    def clean_email(self):
        email = self.cleaned_data["email"]
        if is_disposable(email):
            raise forms.ValidationError("Disposable email addresses are not allowed.")
        return email

Updating the domain list

The bundled domains.txt is sourced from disposable/disposable-email-domains and updated with each package release.

To update manually, run:

curl -sL https://raw.githubusercontent.com/disposable/disposable-email-domains/master/domains.txt \
  -o disposable_email/domains.txt

Then bump the version in pyproject.toml and re-publish.

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

python_disposable-0.0.1.tar.gz (547.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_disposable-0.0.1-py3-none-any.whl (547.9 kB view details)

Uploaded Python 3

File details

Details for the file python_disposable-0.0.1.tar.gz.

File metadata

  • Download URL: python_disposable-0.0.1.tar.gz
  • Upload date:
  • Size: 547.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_disposable-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a5e96dec7780712cd0ab11c6b3592c82b20b439e3dc9a34a5f2bbd60f90c8a21
MD5 20714e5cd82086cb7aef5a8061df625c
BLAKE2b-256 07b5e5a748cb7ca56282575f43d9920b90657864298a0493851e782dbee87873

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_disposable-0.0.1.tar.gz:

Publisher: publish.yml on pescheckit/python-disposable

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_disposable-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_disposable-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1837af3143ad97abc25b0002fab13b6e0d3032db780776f6100a0d78325e56c0
MD5 7de2faf06f156bcfd41be9f8249a3b6b
BLAKE2b-256 6864b4a78306f0b7086af7d84cff59e6f0cce5809d17a8cf4e51a20b94b4fa08

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_disposable-0.0.1-py3-none-any.whl:

Publisher: publish.yml on pescheckit/python-disposable

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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