django-email-validators


Namedjango-email-validators JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
Summaryno more invalid or disposable emails in your database.
upload_time2025-11-06 00:56:53
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT License Copyright (c) 2025-present Fabio Caccamo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python django email validation validator disposable deliverable mx check strict validator verification
VCS
bugtrack_url
requirements django disposable-email-domains email-validator mailchecker pyIsEmail
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![](https://img.shields.io/pypi/pyversions/django-email-validators.svg?color=3776AB&logo=python&logoColor=white)](https://www.python.org/)
[![](https://img.shields.io/pypi/djversions/django-email-validators?color=0C4B33&logo=django&logoColor=white&label=django)](https://www.djangoproject.com/)

[![](https://img.shields.io/pypi/v/django-email-validators.svg?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/django-email-validators/)
[![](https://static.pepy.tech/badge/django-email-validators/month)](https://pepy.tech/project/django-email-validators)
[![](https://img.shields.io/github/stars/fabiocaccamo/django-email-validators?logo=github&style=flat)](https://github.com/fabiocaccamo/django-email-validators/stargazers)
[![](https://img.shields.io/pypi/l/django-email-validators.svg?color=blue)](https://github.com/fabiocaccamo/django-email-validators/blob/main/LICENSE.txt)

[![](https://results.pre-commit.ci/badge/github/fabiocaccamo/django-email-validators/main.svg)](https://results.pre-commit.ci/latest/github/fabiocaccamo/django-email-validators/main)
[![](https://img.shields.io/github/actions/workflow/status/fabiocaccamo/django-email-validators/test-package.yml?branch=main&label=build&logo=github)](https://github.com/fabiocaccamo/django-email-validators)
[![](https://img.shields.io/codecov/c/gh/fabiocaccamo/django-email-validators?logo=codecov)](https://codecov.io/gh/fabiocaccamo/django-email-validators)
[![](https://img.shields.io/badge/code%20style-black-000000.svg?logo=python&logoColor=black)](https://github.com/psf/black)
[![](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

# django-email-validators
no more invalid or disposable emails in your database.

## Installation
-   Run `pip install django-email-validators`
-   Add `django_email_validators` to `settings.INSTALLED_APPS`
-   Restart your application server

## Usage

### Validators
- ๐Ÿ—‘๏ธ `validate_email_non_disposable`
- ๐ŸŒ `validate_email_mx`
- โœ๏ธ `validate_email_provider_typo`

#### `validate_email_non_disposable`
Validates that the email is not from a disposable email provider *(fast, offline check)*.

#### `validate_email_mx`
Validates that the email domain has valid MX records *(slow, requires network access)*.

#### `validate_email_provider_typo`
Validates that the email domain is not a likely typo of a common email provider.
Checks a one-character diff against 80+ common providers and verifies the domain has no valid MX records (prevents false positives).

**Examples that will be caught:**
- `user@gmai.com` -> suggests `user@gmail.com`
- `user@gmail.co` -> suggests `user@gmail.com`
- `user@yahooo.com` -> suggests `user@yahoo.com`

#### Usage
```python
from django.db import models
from django_email_validators import (
    validate_email_non_disposable,
    validate_email_mx,
    validate_email_provider_typo,
)

class User(models.Model):
    email = models.EmailField(
        validators=[
            validate_email_non_disposable,
            validate_email_mx,
            validate_email_provider_typo,
        ]
    )
```

## Testing
```bash
# clone repository
git clone https://github.com/fabiocaccamo/django-email-validators.git && cd django-email-validators

# create virtualenv and activate it
python -m venv venv && . venv/bin/activate

# upgrade pip
python -m pip install --upgrade pip

# install requirements
pip install -r requirements.txt -r requirements-test.txt

# install pre-commit to run formatters and linters
pre-commit install --install-hooks

# run tests
tox
# or
pytest
```

## License
Released under [MIT License](LICENSE.txt).

---

## Supporting

- :star: Star this project on [GitHub](https://github.com/fabiocaccamo/django-email-validators)
- :octocat: Follow me on [GitHub](https://github.com/fabiocaccamo)
- :blue_heart: Follow me on [Bluesky](https://bsky.app/profile/fabiocaccamo.bsky.social)
- :moneybag: Sponsor me on [Github](https://github.com/sponsors/fabiocaccamo)

## See also

- [`django-admin-interface`](https://github.com/fabiocaccamo/django-admin-interface) - the default admin interface made customizable by the admin itself. popup windows replaced by modals. ๐Ÿง™ โšก

- [`django-cache-cleaner`](https://github.com/fabiocaccamo/django-cache-cleaner) - clear the entire cache or individual caches easily using the admin panel or management command. ๐Ÿงน

- [`django-colorfield`](https://github.com/fabiocaccamo/django-colorfield) - simple color field for models with a nice color-picker in the admin. ๐ŸŽจ

- [`django-extra-settings`](https://github.com/fabiocaccamo/django-extra-settings) - config and manage typed extra settings using just the django admin. โš™๏ธ

- [`django-maintenance-mode`](https://github.com/fabiocaccamo/django-maintenance-mode) - shows a 503 error page when maintenance-mode is on. ๐Ÿšง ๐Ÿ› ๏ธ

- [`django-redirects`](https://github.com/fabiocaccamo/django-redirects) - redirects with full control. โ†ช๏ธ

- [`django-treenode`](https://github.com/fabiocaccamo/django-treenode) - probably the best abstract model / admin for your tree based stuff. ๐ŸŒณ

- [`python-benedict`](https://github.com/fabiocaccamo/python-benedict) - dict subclass with keylist/keypath support, I/O shortcuts (base64, csv, json, pickle, plist, query-string, toml, xml, yaml) and many utilities. ๐Ÿ“˜

- [`python-codicefiscale`](https://github.com/fabiocaccamo/python-codicefiscale) - encode/decode Italian fiscal codes - codifica/decodifica del Codice Fiscale. ๐Ÿ‡ฎ๐Ÿ‡น ๐Ÿ’ณ

- [`python-fontbro`](https://github.com/fabiocaccamo/python-fontbro) - friendly font operations. ๐Ÿงข

- [`python-fsutil`](https://github.com/fabiocaccamo/python-fsutil) - file-system utilities for lazy devs. ๐ŸงŸโ€โ™‚๏ธ

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "django-email-validators",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": "Fabio Caccamo <fabio.caccamo@gmail.com>",
    "keywords": "python, django, email, validation, validator, disposable, deliverable, mx, check, strict, validator, verification",
    "author": null,
    "author_email": "Fabio Caccamo <fabio.caccamo@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/91/44/10f69bea9daf354d7dc393327376a7d5fd8f83c2700ab37c075ca5fb30d3/django_email_validators-0.1.0.tar.gz",
    "platform": null,
    "description": "[![](https://img.shields.io/pypi/pyversions/django-email-validators.svg?color=3776AB&logo=python&logoColor=white)](https://www.python.org/)\n[![](https://img.shields.io/pypi/djversions/django-email-validators?color=0C4B33&logo=django&logoColor=white&label=django)](https://www.djangoproject.com/)\n\n[![](https://img.shields.io/pypi/v/django-email-validators.svg?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/django-email-validators/)\n[![](https://static.pepy.tech/badge/django-email-validators/month)](https://pepy.tech/project/django-email-validators)\n[![](https://img.shields.io/github/stars/fabiocaccamo/django-email-validators?logo=github&style=flat)](https://github.com/fabiocaccamo/django-email-validators/stargazers)\n[![](https://img.shields.io/pypi/l/django-email-validators.svg?color=blue)](https://github.com/fabiocaccamo/django-email-validators/blob/main/LICENSE.txt)\n\n[![](https://results.pre-commit.ci/badge/github/fabiocaccamo/django-email-validators/main.svg)](https://results.pre-commit.ci/latest/github/fabiocaccamo/django-email-validators/main)\n[![](https://img.shields.io/github/actions/workflow/status/fabiocaccamo/django-email-validators/test-package.yml?branch=main&label=build&logo=github)](https://github.com/fabiocaccamo/django-email-validators)\n[![](https://img.shields.io/codecov/c/gh/fabiocaccamo/django-email-validators?logo=codecov)](https://codecov.io/gh/fabiocaccamo/django-email-validators)\n[![](https://img.shields.io/badge/code%20style-black-000000.svg?logo=python&logoColor=black)](https://github.com/psf/black)\n[![](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n# django-email-validators\nno more invalid or disposable emails in your database.\n\n## Installation\n-   Run `pip install django-email-validators`\n-   Add `django_email_validators` to `settings.INSTALLED_APPS`\n-   Restart your application server\n\n## Usage\n\n### Validators\n- \ud83d\uddd1\ufe0f `validate_email_non_disposable`\n- \ud83c\udf10 `validate_email_mx`\n- \u270d\ufe0f `validate_email_provider_typo`\n\n#### `validate_email_non_disposable`\nValidates that the email is not from a disposable email provider *(fast, offline check)*.\n\n#### `validate_email_mx`\nValidates that the email domain has valid MX records *(slow, requires network access)*.\n\n#### `validate_email_provider_typo`\nValidates that the email domain is not a likely typo of a common email provider.\nChecks a one-character diff against 80+ common providers and verifies the domain has no valid MX records (prevents false positives).\n\n**Examples that will be caught:**\n- `user@gmai.com` -> suggests `user@gmail.com`\n- `user@gmail.co` -> suggests `user@gmail.com`\n- `user@yahooo.com` -> suggests `user@yahoo.com`\n\n#### Usage\n```python\nfrom django.db import models\nfrom django_email_validators import (\n    validate_email_non_disposable,\n    validate_email_mx,\n    validate_email_provider_typo,\n)\n\nclass User(models.Model):\n    email = models.EmailField(\n        validators=[\n            validate_email_non_disposable,\n            validate_email_mx,\n            validate_email_provider_typo,\n        ]\n    )\n```\n\n## Testing\n```bash\n# clone repository\ngit clone https://github.com/fabiocaccamo/django-email-validators.git && cd django-email-validators\n\n# create virtualenv and activate it\npython -m venv venv && . venv/bin/activate\n\n# upgrade pip\npython -m pip install --upgrade pip\n\n# install requirements\npip install -r requirements.txt -r requirements-test.txt\n\n# install pre-commit to run formatters and linters\npre-commit install --install-hooks\n\n# run tests\ntox\n# or\npytest\n```\n\n## License\nReleased under [MIT License](LICENSE.txt).\n\n---\n\n## Supporting\n\n- :star: Star this project on [GitHub](https://github.com/fabiocaccamo/django-email-validators)\n- :octocat: Follow me on [GitHub](https://github.com/fabiocaccamo)\n- :blue_heart: Follow me on [Bluesky](https://bsky.app/profile/fabiocaccamo.bsky.social)\n- :moneybag: Sponsor me on [Github](https://github.com/sponsors/fabiocaccamo)\n\n## See also\n\n- [`django-admin-interface`](https://github.com/fabiocaccamo/django-admin-interface) - the default admin interface made customizable by the admin itself. popup windows replaced by modals. \ud83e\uddd9 \u26a1\n\n- [`django-cache-cleaner`](https://github.com/fabiocaccamo/django-cache-cleaner) - clear the entire cache or individual caches easily using the admin panel or management command. \ud83e\uddf9\n\n- [`django-colorfield`](https://github.com/fabiocaccamo/django-colorfield) - simple color field for models with a nice color-picker in the admin. \ud83c\udfa8\n\n- [`django-extra-settings`](https://github.com/fabiocaccamo/django-extra-settings) - config and manage typed extra settings using just the django admin. \u2699\ufe0f\n\n- [`django-maintenance-mode`](https://github.com/fabiocaccamo/django-maintenance-mode) - shows a 503 error page when maintenance-mode is on. \ud83d\udea7 \ud83d\udee0\ufe0f\n\n- [`django-redirects`](https://github.com/fabiocaccamo/django-redirects) - redirects with full control. \u21aa\ufe0f\n\n- [`django-treenode`](https://github.com/fabiocaccamo/django-treenode) - probably the best abstract model / admin for your tree based stuff. \ud83c\udf33\n\n- [`python-benedict`](https://github.com/fabiocaccamo/python-benedict) - dict subclass with keylist/keypath support, I/O shortcuts (base64, csv, json, pickle, plist, query-string, toml, xml, yaml) and many utilities. \ud83d\udcd8\n\n- [`python-codicefiscale`](https://github.com/fabiocaccamo/python-codicefiscale) - encode/decode Italian fiscal codes - codifica/decodifica del Codice Fiscale. \ud83c\uddee\ud83c\uddf9 \ud83d\udcb3\n\n- [`python-fontbro`](https://github.com/fabiocaccamo/python-fontbro) - friendly font operations. \ud83e\udde2\n\n- [`python-fsutil`](https://github.com/fabiocaccamo/python-fsutil) - file-system utilities for lazy devs. \ud83e\udddf\u200d\u2642\ufe0f\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025-present Fabio Caccamo\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "no more invalid or disposable emails in your database.",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://github.com/fabiocaccamo/django-email-validators#readme",
        "Download": "https://github.com/fabiocaccamo/django-email-validators/releases",
        "Funding": "https://github.com/sponsors/fabiocaccamo/",
        "Homepage": "https://github.com/fabiocaccamo/django-email-validators",
        "Issues": "https://github.com/fabiocaccamo/django-email-validators/issues",
        "Twitter": "https://twitter.com/fabiocaccamo"
    },
    "split_keywords": [
        "python",
        " django",
        " email",
        " validation",
        " validator",
        " disposable",
        " deliverable",
        " mx",
        " check",
        " strict",
        " validator",
        " verification"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fdea5d56e231641164d5214d1aad22514de1105ada30136bf016a66b88481102",
                "md5": "2ebd13602033382a6138552eb36aa996",
                "sha256": "fdc538270944e11b787968875fd105469df1cefecf341c15e1fb732f76a2f0ee"
            },
            "downloads": -1,
            "filename": "django_email_validators-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2ebd13602033382a6138552eb36aa996",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 12365,
            "upload_time": "2025-11-06T00:56:52",
            "upload_time_iso_8601": "2025-11-06T00:56:52.172142Z",
            "url": "https://files.pythonhosted.org/packages/fd/ea/5d56e231641164d5214d1aad22514de1105ada30136bf016a66b88481102/django_email_validators-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "914410f69bea9daf354d7dc393327376a7d5fd8f83c2700ab37c075ca5fb30d3",
                "md5": "c59467529a1402c95e09f5e951c2aaf9",
                "sha256": "3d8deebd6f7a081c7320d2193e430ad614091d61eb39259a71b6867ce00b204e"
            },
            "downloads": -1,
            "filename": "django_email_validators-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c59467529a1402c95e09f5e951c2aaf9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14157,
            "upload_time": "2025-11-06T00:56:53",
            "upload_time_iso_8601": "2025-11-06T00:56:53.477415Z",
            "url": "https://files.pythonhosted.org/packages/91/44/10f69bea9daf354d7dc393327376a7d5fd8f83c2700ab37c075ca5fb30d3/django_email_validators-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-06 00:56:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fabiocaccamo",
    "github_project": "django-email-validators#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "django",
            "specs": [
                [
                    ">=",
                    "4.0"
                ]
            ]
        },
        {
            "name": "disposable-email-domains",
            "specs": [
                [
                    "==",
                    "0.0.*"
                ]
            ]
        },
        {
            "name": "email-validator",
            "specs": [
                [
                    "==",
                    "2.3.*"
                ]
            ]
        },
        {
            "name": "mailchecker",
            "specs": [
                [
                    "==",
                    "6.0.*"
                ]
            ]
        },
        {
            "name": "pyIsEmail",
            "specs": [
                [
                    "==",
                    "2.0.*"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "django-email-validators"
}
        
Elapsed time: 1.63003s