Created
July 1, 2020 16:11
-
-
Save checchia/8485102adf39bd62d8f1a14134a9c108 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, os, tldextract, enchant | |
d = enchant.Dict("pt_BR") | |
e = enchant.Dict("en_US") | |
def extrai_sld(dominio): | |
sld = tldextract.extract(dominio) | |
marca = sld.domain | |
return marca | |
def check_decimal(marca): | |
if marca.isdecimal() is False: | |
if not "-" in marca: | |
return "OK" | |
return "nok" | |
def isValid(marca): | |
if d.check(marca) or e.check(marca): | |
return "OK" | |
return "nok" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment