Skip to main content

isDisposable

isdisposable

Detect disposable emails in Python. One function call.

PyPI version Python versions License

Open-source disposable email detection with 160,000+ domains.
Offline-first. Zero dependencies. Fully typed.

Website · Docs · API Reference


Install

pip install isdisposable

Usage

from isdisposable import is_disposable

is_disposable("test@mailinator.com")  # True
is_disposable("user@gmail.com")       # False

Synchronous. Offline. Zero config.

Bulk Check

from isdisposable import is_disposable_bulk

results = is_disposable_bulk([
    "a@tempmail.com",
    "b@gmail.com",
    "c@guerrillamail.com",
])
# [True, False, True]

Domain Check

from isdisposable import is_domain_disposable

is_domain_disposable("mailinator.com")  # True
is_domain_disposable("gmail.com")       # False

API Mode — Real-time Detection

For DNS/MX validation, risk scoring, and domain age analysis:

from isdisposable import create_client

client = create_client(api_key="isd_live_xxxxx")

result = client.check("test@suspicious-domain.com")
print(result.disposable)       # True
print(result.score)            # 95
print(result.reason)           # "blocklist_match"
print(result.mx_valid)         # True
print(result.domain_age_days)  # 3

The API client automatically falls back to offline detection on network errors.

Error Handling

from isdisposable import create_client
from isdisposable.client import AuthenticationError, RateLimitError

client = create_client(api_key="wrong_key")

try:
    result = client.check("test@example.com")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError:
    print("Too many requests")

Bulk API Check

results = client.check_bulk([
    "a@tempmail.com",
    "b@gmail.com",
])
for r in results:
    print(f"{r.email}: {r.disposable} (score: {r.score})")

Framework Integrations

Django — Form Validation
from django import forms
from isdisposable import is_disposable

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

    def clean_email(self):
        email = self.cleaned_data["email"]
        if is_disposable(email):
            raise forms.ValidationError("Disposable emails are not allowed.")
        return email
FastAPI — Dependency
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from isdisposable import is_disposable

app = FastAPI()

class SignupRequest(BaseModel):
    email: str
    password: str

@app.post("/signup")
def signup(req: SignupRequest):
    if is_disposable(req.email):
        raise HTTPException(400, "Disposable emails are not allowed")
    return {"ok": True}
Flask — Before Request
from flask import Flask, request, jsonify
from isdisposable import is_disposable

app = Flask(__name__)

@app.route("/signup", methods=["POST"])
def signup():
    email = request.json.get("email", "")
    if is_disposable(email):
        return jsonify(error="Disposable emails are not allowed"), 400
    return jsonify(ok=True)
Pydantic — Field Validator
from pydantic import BaseModel, field_validator
from isdisposable import is_disposable

class User(BaseModel):
    email: str

    @field_validator("email")
    @classmethod
    def check_disposable(cls, v: str) -> str:
        if is_disposable(v):
            raise ValueError("Disposable emails are not allowed")
        return v

API Reference

is_disposable(email: str) -> bool

Returns True if the email is from a disposable provider.

is_disposable_bulk(emails: list[str]) -> list[bool]

Bulk check. Returns list of booleans matching input order.

is_domain_disposable(domain: str) -> bool

Check a domain directly.

extract_domain(email: str) -> str | None

Extract the domain from an email address.

create_client(api_key, ...) -> IsDisposableClient

Create an API client with .check(), .check_bulk(), and .clear_cache().

SDKs

Language Package Status
JavaScript/TypeScript @isdisposable/js Stable
Python isdisposable Stable
Go isdisposable-go Coming soon

License

MIT


Built by Junaid Shaukat
Dashboard & API at isdisposable.com

Metadata

Release files for isdisposable 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for isdisposable 1.0.0
File Size Uploaded Provenance
isdisposable-1.0.0.tar.gz 929.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for isdisposable 1.0.0
File Interpreter ABI Platform
isdisposable-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.9 MB

Release files / isdisposable-1.0.0.tar.gz

Download URL isdisposable-1.0.0.tar.gz
Size 929.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ef859767d1727319aaebaddd318977dc95ab58a59facd51152bb23368956f8bc
BLAKE2b-256 checksum
How to use checksums
2f4a0733d1d2e95f55ac1d42498b8ff7964d6d80ce87f10d9ea4f8663afa995a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / isdisposable-1.0.0-py3-none-any.whl

Download URL isdisposable-1.0.0-py3-none-any.whl
Size 929.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f3cd164085580deef16c4ddf7cda8e3d7dfb8fc81b362c5090d327dcdd60efe
BLAKE2b-256 checksum
How to use checksums
eed43337326abaadd2a06a75bd5820765bf7844269da681c21ca3588bea94475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for isdisposable 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page