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 lightweight Python package to detect disposable/temporary email addresses. Bundles 72,000+ domains from disposable/disposable-email-domains, updated daily — no network calls at runtime.
Installation
pip install python-disposable
Usage
Basic check
from disposable_email import is_disposable, is_valid
is_disposable("user@mailinator.com") # True
is_disposable("user@gmail.com") # False
# Works with bare domains too
is_disposable("guerrillamail.com") # True
# Inverse
is_valid("user@gmail.com") # True
Strict mode
Strict mode also flags greylisted domains — services that allow anonymous signups but aren't purely disposable (e.g. some free email providers).
is_disposable("example.com", strict=True)
is_valid("example.com", strict=True)
Subdomain handling
Subdomains are automatically resolved to their parent domain.
is_disposable("mail.mailinator.com") # True
is_disposable("a.b.guerrillamail.com") # True
Get the full domain set
from disposable_email import get_domains
domains = get_domains() # frozenset of 72k+ domains
domains_strict = get_domains(strict=True) # frozenset of strict list
Domain count
from disposable_email import domain_count
domain_count() # 72170
domain_count(strict=True) # 26468
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
API reference
| Function | Description |
|---|---|
is_disposable(email_or_domain, strict=False) |
Returns True if the email/domain is disposable |
is_valid(email_or_domain, strict=False) |
Returns True if the email/domain is not disposable |
get_domains(strict=False) |
Returns the full frozenset of known disposable domains |
domain_count(strict=False) |
Returns the number of bundled domains |
Data source
Domain lists are sourced from disposable/disposable-email-domains and bundled at release time. The upstream list is updated daily via automated scraping of 40+ sources.
This package checks for upstream updates every 4 hours and automatically publishes a new version to PyPI when changes are detected.
License
MIT — see 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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_disposable-0.0.4.tar.gz.
File metadata
- Download URL: python_disposable-0.0.4.tar.gz
- Upload date:
- Size: 548.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18486e46b32b268c6d09e4ca53d4e739febdedcbdf1fd8637100a75d868ff2d7
|
|
| MD5 |
841c2cc5053b450047e83512e22531e0
|
|
| BLAKE2b-256 |
398d83cb192a249887978a7a72664e2fbab8a00b2c1a898ed0476927dd0a9e58
|
Provenance
The following attestation bundles were made for python_disposable-0.0.4.tar.gz:
Publisher:
publish.yml on pescheckit/python-disposable
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_disposable-0.0.4.tar.gz -
Subject digest:
18486e46b32b268c6d09e4ca53d4e739febdedcbdf1fd8637100a75d868ff2d7 - Sigstore transparency entry: 1133584792
- Sigstore integration time:
-
Permalink:
pescheckit/python-disposable@ac6b9c62b942bb4039894c8187258f34cf0312ad -
Branch / Tag:
refs/tags/0.0.4 - Owner: https://github.com/pescheckit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac6b9c62b942bb4039894c8187258f34cf0312ad -
Trigger Event:
release
-
Statement type:
File details
Details for the file python_disposable-0.0.4-py3-none-any.whl.
File metadata
- Download URL: python_disposable-0.0.4-py3-none-any.whl
- Upload date:
- Size: 549.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
134a1303b29f4b13469232d75b4cc3464a961fda312df0dd76e6ca55d4cdee3c
|
|
| MD5 |
62ba03556d669b00f14d2e2c6862ee86
|
|
| BLAKE2b-256 |
ee3fc88ad2af312aa4c2d89aec17d6aaad1efd6cc9b169f23df911af70f18e8d
|
Provenance
The following attestation bundles were made for python_disposable-0.0.4-py3-none-any.whl:
Publisher:
publish.yml on pescheckit/python-disposable
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_disposable-0.0.4-py3-none-any.whl -
Subject digest:
134a1303b29f4b13469232d75b4cc3464a961fda312df0dd76e6ca55d4cdee3c - Sigstore transparency entry: 1133584795
- Sigstore integration time:
-
Permalink:
pescheckit/python-disposable@ac6b9c62b942bb4039894c8187258f34cf0312ad -
Branch / Tag:
refs/tags/0.0.4 - Owner: https://github.com/pescheckit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac6b9c62b942bb4039894c8187258f34cf0312ad -
Trigger Event:
release
-
Statement type: