Download tool.py from CyberMax-tools/email-validate-tool: direct link, hf CLI and curl.
- Browser
- Download file 957 Bytes
-
https://huggingface.co/spaces/CyberMax-tools/email-validate-tool/resolve/main/tool.py
- Command line
-
hf download hf://spaces/CyberMax-tools/email-validate-tool/tool.py
-
curl -L -o tool.py https://huggingface.co/spaces/CyberMax-tools/email-validate-tool/resolve/main/tool.py
957 Bytes
| from typing import Any, Optional | |
| from smolagents.tools import Tool | |
| import requests | |
| class EmailValidateTool(Tool): | |
| name = "email_validate" | |
| description = "Mailvett by CyberMax: validate up to 10 email addresses (syntax, MX, disposable/role/free-provider flags, SPF/DMARC, typo suggestion) and get a deliverable/risky/undeliverable verdict with a score. Free tier, no key; paid keys at https://mailvett.cybermax-tools.workers.dev/docs" | |
| inputs = {'emails': {'type': 'string', 'description': "Comma-separated email addresses, e.g. 'ana@example.com,bob@gmial.com'"}} | |
| output_type = "object" | |
| def forward(self, emails: str): | |
| import requests | |
| r = requests.get("https://mailvett.cybermax-tools.workers.dev/api/validate", | |
| params={"email": emails, "suggestTypos": "true", "via": "smolagents"}, timeout=30) | |
| return r.json() | |
| def __init__(self, *args, **kwargs): | |
| self.is_initialized = False | |