Registry / auth-security / disposable-email-domains

disposable-email-domains

JSON →
library0.0.246pypypi✓ verified 26d ago

The `disposable-email-domains` Python library provides a collection of known disposable and temporary email address domains. It's designed to help applications identify and block registrations or interactions from email addresses often used for spam, abuse, or privacy-conscious temporary sign-ups. The list is periodically updated, with the current version being 0.0.169, reflecting changes from the primary `disposable-email-domains` project. [1, 4]

pip install disposable-email-domains
INSTALL
IMPORT
SIG · DISPOSABLE-EMAIL-D
D
disposable-email-domains
auth-securitypythonv0.0.246
Install
1.7s avg
Import
10ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.246 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.008s · 18.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.002s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

blocklist
from disposable_email_domains import blocklist

This quickstart demonstrates how to import the `blocklist` set and check if a given email address's domain is present within it. It's crucial to convert the domain to lowercase for an accurate check, as all domains in the `blocklist` are lowercase. [4]

from disposable_email_domains import blocklist def is_disposable_email(email_address): domain = email_address.split('@')[-1].lower() return domain in blocklist # Example usage: email1 = "test@mailinator.com" email2 = "user@example.com" print(f"Is '{email1}' from a disposable domain? {is_disposable_email(email1)}") print(f"Is '{email2}' from a disposable domain? {is_disposable_email(email2)}")
Debug
Known issues
gotchaThe `blocklist` is a static dataset compiled at release time. New disposable domains appear daily, and existing ones can change status. This means the list can become outdated between releases, potentially leading to false negatives (missing new disposable domains) or false positives (blocking legitimate domains that are no longer disposable). For the most up-to-date and comprehensive checks, consider integrating with a real-time email validation API service. [3, 19]
fix
Regularly update the library to the latest version (`pip install --upgrade disposable-email-domains`). For critical applications requiring real-time accuracy, combine this library with an external email validation API that offers dynamic updates and deeper checks. [3, 10, 19]
affects: All versions
gotchaThis library only provides a list of disposable domains; it does not perform full email address validation. It will not check for correct email format, valid MX records, or if a mailbox actually exists. Relying solely on this list for email validation can leave your application vulnerable to malformed or non-existent email addresses from non-disposable domains. [18, 19]
fix
For comprehensive email validation, combine the use of this `blocklist` with other validation steps, such as regex for format checking, MX record lookups, and optionally, real-time mailbox verification services. [18]
affects: All versions
gotchaDomains in the `blocklist` are guaranteed to be fully lowercased. Input domains must also be converted to lowercase before checking against the `blocklist` to ensure accurate matching. Failing to lowercase the input domain will result in an incorrect `False` for disposable domains with mixed-case or uppercase characters. [4]
fix
Always convert the domain part of an email address to lowercase (e.g., `email_address.split('@')[-1].lower()`) before checking if it is in the `disposable_email_domains.blocklist`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'disposable_email_domains'
The `disposable-email-domains` library has not been installed in your Python environment or is not accessible.
fix
Install the library using pip: `pip install disposable-email-domains`
AttributeError: module 'disposable_email_domains' has no attribute 'is_disposable'
Developers often expect a function like `is_disposable` to check if a domain is disposable, but this library provides a Python `set` named `blocklist` for direct domain lookup.
fix
Import the `blocklist` set and use the `in` operator for checking: `from disposable_email_domains import blocklist; domain_to_check = 'example.com'; is_disposable = domain_to_check.lower() in blocklist`
AttributeError: module 'disposable_email_domains' has no attribute 'check'
Similar to `is_disposable`, users might attempt to call a `check` method which does not exist in the `disposable-email-domains` library. The library exposes a `set` named `blocklist` for direct domain comparisons.
fix
Access the `blocklist` set and perform a case-insensitive check directly: `from disposable_email_domains import blocklist; email_domain = 'TestMail.com'; if email_domain.lower() in blocklist: print('Disposable domain detected.')`
Upgrade
Version history
0.0.246latest on PyPI · released Aug 27, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
disposable-email-domains — pip install disposable-email-domains · libregistry