Skip to content

Instantly share code, notes, and snippets.

@checchia
Last active July 1, 2020 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save checchia/1e6026ecb8f044c3a90f6b4acb6ae9ae to your computer and use it in GitHub Desktop.
Save checchia/1e6026ecb8f044c3a90f6b4acb6ae9ae to your computer and use it in GitHub Desktop.
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"
def tamanho(marca):
if len(marca)> 3 and len(marca) <10:
return "OK"
else:
return "nok"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment