Python client for block-disposable-email.com
Installation
pip install block-disposable-email
Simple usage (email)
from bdea.client import is_disposable_email
- if is_disposable_email(‘spam@mailinator.com’, ‘example_apikey_12345’):
print(“Email is disposable”)
- else:
print(“Email is valid”)
Simple usage (domain)
from bdea.client import is_disposable_domain
- if is_disposable_domain(‘mailinator.com’, ‘example_apikey_12345’):
print(“Domain is disposable”)
- else:
print(“Domain is valid”)
Django validator
Add your apikey to Django settings.py:
BDEA_APIKEY = ‘example_apikey_12345’
Add validator to your EmailField:
from django import forms from bdea.django_validators import disposable_email_validator
- class EmailField(forms.EmailField):
default_validators = forms.EmailField.default_validators + [disposable_email_validator]
Advanced usage
from bdea.client import BDEAClient
cl = BDEAClient(‘example_apikey_12345’, timeout=5)
# examine API status res = cl.get_api_status() print(res.status(), res.credit_status(), res.credits())
# get raw API response print(res.response)
# validate domain res = cl.get_domain_status(‘mailinator.com’) print(res.is_disposable(), res.status())
# get raw API response print(res.response)
Development
To bootstrap your development environment, install virtualenvwrapper and run the following commands from project directory:
mkvirtualenv disposable setvirtualenvproject pip install -r requirements/dev.txt pip install -e ./
To run tests use py.test, or run the following command:
tox
Metadata
Release files for block-disposable-email 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| block-disposable-email-2.0.0.tar.gz | 4.3 kB | Without provenance | Details for block-disposable-email-2.0.0.tar.gz |
Release files / block-disposable-email-2.0.0.tar.gz
| Download URL | block-disposable-email-2.0.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ecd0398d756bacd3708f350307b850ce54f28ac3cbf657bf8c9bfa5b598476a
|
|
BLAKE2b-256 checksum How to use checksums |
0032d16726fea4af803856305cfbc46b8650993f0fe5348883063a7fca06c21d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.7
|
Security for block-disposable-email 2.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.