{"id":14047532,"url":"https://github.com/bnkc/emval","last_synced_at":"2025-07-27T20:32:52.107Z","repository":{"id":252010633,"uuid":"828409960","full_name":"bnkc/emval","owner":"bnkc","description":"emval is a blazingly fast python email validator written in rust.","archived":false,"fork":false,"pushed_at":"2025-07-03T02:54:24.000Z","size":252,"stargazers_count":194,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-24T18:57:08.782Z","etag":null,"topics":["email-validator","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bnkc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-14T04:11:01.000Z","updated_at":"2025-07-10T11:16:20.000Z","dependencies_parsed_at":"2024-08-12T10:21:21.555Z","dependency_job_id":null,"html_url":"https://github.com/bnkc/emval","commit_stats":null,"previous_names":["bnkc/emv","bnkc/emval"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bnkc/emval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnkc%2Femval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnkc%2Femval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnkc%2Femval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnkc%2Femval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnkc","download_url":"https://codeload.github.com/bnkc/emval/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnkc%2Femval/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267419095,"owners_count":24084102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email-validator","python","rust"],"created_at":"2024-08-12T10:01:55.240Z","updated_at":"2025-07-27T20:32:52.070Z","avatar_url":"https://github.com/bnkc.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# 📬 emval\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"LICENSE\" alt=\"License\"\u003e\n    \u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/bnkc/emval?style=for-the-badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/bnkc/emval/releases\" alt=\"Releases\"\u003e\n    \u003cimg alt=\"GitHub Release\" src=\"https://img.shields.io/github/v/release/bnkc/emval?style=for-the-badge\u0026logo=github\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/bnkc/emval/commits/main/\" alt=\"Latest Commits\"\u003e\n    \u003cimg alt=\"GitHub last commit\" src=\"https://img.shields.io/github/last-commit/bnkc/emval?style=for-the-badge\u0026logo=github\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/bnkc/emval/actions\" alt=\"Build Status\"\u003e\n    \u003cimg alt=\"GitHub Actions Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/bnkc/emval/CI.yml?style=for-the-badge\u0026logo=github\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/emval\" alt=\"bnkc on crates.io\"\u003e\n    \u003cimg alt=\"Crates.io Version\" src=\"https://img.shields.io/crates/v/emval?style=for-the-badge\u0026logo=rust\u0026logoColor=red\u0026color=red\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://docs.rs/emval\" alt=\"Rustitude documentation on docs.rs\"\u003e\n    \u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/docsrs/emval?style=for-the-badge\u0026logo=rust\u0026logoColor=red\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/emval/\" alt=\"PyPI\"\u003e\n    \u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/emval?style=for-the-badge\u0026logo=pypi\u0026logoColor=yellow\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n`emval` is a blazingly fast email validator written in Rust with Python bindings, offering performance improvements of 100-1000x over traditional validators.\n\n![performance image](https://raw.githubusercontent.com/bnkc/emval/b90cc4a0ae24e329702872c4fb1cccf212d556a6/perf.svg)\n\n## Features\n\n- Drop-in replacement for popular email validators like `python-email-validator`, `verify-email`, and `pyIsEmail`.\n- 100-1000x faster than [python-email-validator](https://github.com/JoshData/python-email-validator).\n- Validates email address syntax according to [RFC 5322](https://www.rfc-editor.org/rfc/rfc5322.html) and [RFC 6531](https://www.rfc-editor.org/rfc/rfc6531.html).\n- Checks domain deliverability (coming soon).\n- Supports internationalized domain names (IDN) and local parts.\n- Provides user-friendly syntax errors.\n- Normalizes addresses.\n- Rejects invalid and unsafe Unicode characters.\n\n## Getting Started\n\nInstall `emval` from PyPI:\n\n```sh\npip install emval\n```\n\nor use `emval` in a Rust project:\n```sh\ncargo add emval\n```\n\n## Usage\n\n### Quick Start\n\nTo validate an email address in Python:\n\n```python\nfrom emval import validate_email, EmailValidator\n\nemail = \"example@domain.com\"\n\ntry:\n    # Check if the email is valid.\n    val_email = validate_email(email)\n    # Utilize the normalized form for storage.\n    normalized_email = val_email.normalized\nexcept Exception as e:\n    # Example: \"Invalid Local Part: Quoting the local part before the '@' sign is not permitted in this context.\"\n    print(str(e))\n```\n\nThe same code in Rust:\n```rust\nuse emval::{validate_email, ValidationError};\n\nfn main() -\u003e Result\u003c(), ValidationError\u003e {\n    let email = \"example@domain.com\";\n    let val_email = validate_email(email)?;\n    let normalized_email = val_email.normalized;\n    Ok(())\n}\n```\n\n### Configurations\n\nCustomize email validation behavior using the `EmailValidator` class:\n\n```python\nfrom emval import EmailValidator\n\nemval = EmailValidator(\n    allow_smtputf8=False,\n    allow_empty_local=True,\n    allow_quoted_local=True,\n    allow_domain_literal=True,\n    deliverable_address=False,\n    allowed_special_domains=['test', 'invalid'],\n)\n\nemail = \"user@[192.168.1.1]\"\n\ntry:\n    validated_email = emval.validate_email(email)\n    print(validated_email)\nexcept Exception as e:\n    print(str(e))\n```\n\nThe same code in Rust:\n```rust\nuse emval::{EmailValidator, ValidationError};\n\nfn main() -\u003e Result\u003c(), ValidationError\u003e {\n    let emval = EmailValidator {\n        allow_smtputf8: false,\n        allow_empty_local: true,\n        allow_quoted_local: true,\n        allow_domain_literal: true,\n        deliverable_address: false,\n        allowed_special_domains: vec![\"test\".to_string(), \"invalid\".to_string()],\n    };\n\n    let email = \"example@domain.com\";\n    let validated_email = emval.validate_email(email)?;\n    Ok(())\n}\n```\n\n### Options\n\n- `allow_smtputf8`: Allows internationalized email addresses.\n- `allow_empty_local`: Allows an empty local part (e.g., `@domain.com`).\n- `allow_quoted_local`: Allows quoted local parts (e.g., `\"user name\"@domain.com`).\n- `allow_domain_literal`: Allows domain literals (e.g., `[192.168.0.1]`).\n- `deliverable_address`: Checks if the email address is deliverable by verifying the domain's MX records.\n- `allowed_special_domains`: List of special-use domains to allow despite being reserved (e.g., `['test', 'invalid']`).\n\n## Technical Details\n\n### Email Address Syntax\n\nemval adheres to the syntax rules defined in [RFC 5322](https://www.rfc-editor.org/rfc/rfc5322.html) and [RFC 6531](https://www.rfc-editor.org/rfc/rfc6531.html). It supports both ASCII and internationalized characters.\n\n### Internationalized Email Addresses\n\n#### Domain Names\n\nemval converts non-ASCII domain names into their ASCII \"Punycode\" form according to [IDNA 2008](https://www.rfc-editor.org/rfc/rfc5891.html). This ensures compatibility with systems that do not support Unicode.\n\n#### Local Parts\n\nemval allows international characters in the local part of email addresses, following [RFC 6531](https://www.rfc-editor.org/rfc/rfc6531.html). It offers options to handle environments without SMTPUTF8 support.\n\n### Unsafe Unicode Characters\n\nemval rejects unsafe Unicode characters to enhance security, preventing display and interpretation issues.\n\n### Normalization\n\nemval normalizes email addresses to ensure consistency:\n\n- **Lowercasing domains:** Domain names are standardized to lowercase.\n- **Unicode NFC normalization:** Characters are transformed into their precomposed forms.\n- **Removing unnecessary characters:** Quotes and backslashes in the local part are removed.\n\n## Acknowledgements\n\nThis project draws inspiration from [python-email-validator](https://github.com/JoshData/python-email-validator). While `python-email-validator` is more comprehensive, `emval` aims to provide a faster solution.\n\n## Getting Help\n\nFor questions and issues, please open an issue in the [GitHub issue tracker](https://github.com/bnkc/emval/issues).\n\n## License\n\nemval is licensed under the [MIT License](https://opensource.org/licenses/MIT). See the [LICENSE](https://github.com/bnkc/emval/blob/main/LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnkc%2Femval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnkc%2Femval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnkc%2Femval/lists"}