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 python-disposable

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.2.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.2-py3-none-any.whl (547.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_disposable-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 1b601b354e40f6831750841995ea6a7dbe82e20e0863702b2f56464094440693
MD5 c90485cc7d310a0ff5403b594d5678aa
BLAKE2b-256 e74046a396cfec0f1d364d7897756d0a783a3d510cdff921594ad62e1f99e9b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_disposable-0.0.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_disposable-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d063ce159954ad1a44c442b8723975b466b9e5c7c560e3262f6756e4c456fe93
MD5 8151336a5bdd03649839508386f2850c
BLAKE2b-256 34974a244f9bcd8c8ac66c19aa8ebecbe60d4b30311cae6b63d9d9bd056261f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_disposable-0.0.2-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