Um pacote para validar diverso tipos de dados e documentos
Project description
multivalidator
Um validador e gerador para os seguintes parâmetros:
- Bank Card
- CNPJ
- CPF
- Date
- FoneNumber
- PassPort
- PassWord
- Url
Instalação
pip install multi-validator-generator
Exemplos
- Importanto biblioteca
import multivalidator as mv
read
# read: Retorna um objeto iterável que contém o parâmetro escolhido
# Exemplo:
cpf = mv.cpf.read("529.982.247-25")
cnpj = mv.cnpj.read("92.639.324/0001-92")
date = mv.date.read("08-04-2021")
email = mv.emails.read("teste@gmail.com")
fone = mv.fone_number.read("11999999999")
passport = mv.passport.read("AB1234567")
password = mv.password.read("123456789")
url = mv.url.read("https://www.google.com")
bank_card = mv.bank_card.read("5555666677778884")
generate
# Gera um cpf válido e adiciona-o no objeto iterável
cpf.generate()
# Saida: ['529.982.247-25', '262.848.575-35']
# Aviso: Alguns geradores necessitam de parâmetros na sua chamada(Consulte a documentação)
validate
# Retorna uma tupla com um valor booleano indicando se é valido, e o cpf formatado
cpf.validate('529.982.247-25')
#Saída: (True, '529.982.247-25')
add
# Adiciona um cpf no objeto iterável existente.
cpf.add('529.982.247-25')
#Saída: ['529.982.247-25', '262.848.575-35', '171.414.230-28']
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file multi-validator-generator-0.0.8.tar.gz
.
File metadata
- Download URL: multi-validator-generator-0.0.8.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c4bdd2c897ba1df346682ba8dd24f661f020a7ee0343b3058cd1281c136b96f |
|
MD5 | 4a977aa97f9df6dc05808907976de81c |
|
BLAKE2b-256 | fa84094f80e9d022d426fbf1f9c72049b357ff3b24a649ce53673aa4a058167c |
File details
Details for the file multi_validator_generator-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: multi_validator_generator-0.0.8-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11eb516905a838bd9f8e7c380332b6833881d7cd714acba3292f3e6e2c55a0fe |
|
MD5 | 992913826e21affd37bd6353551c31df |
|
BLAKE2b-256 | 3a3cb8734d32b1ee128b89a5d6ecd23924ed6e47442be11c702728bbf8263844 |