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
Exemplos
- Importanto biblioteca
import cpf
import cnpj
import date
import emails
import fone_number
import passport
import password
import url
import bank_card
import fake_data
read
# read: Retorna um objeto iterável que contém o parâmetro escolhido
# Exemplo:
cpf = cpf.read("529.982.247-25")
cnpj = cnpj.read("92.639.324/0001-92")
date = date.read("08-04-2021")
email = emails.read("teste@gmail.com")
fone = fone_number.read("11999999999")
passport = passport.read("AB1234567")
password = password.read("123456789")
url = url.read("https://www.google.com")
bank_card = bank_card.CreditCard()
fake_data = fake_data.read(10)
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.3.tar.gz
.
File metadata
- Download URL: multi-validator-generator-0.0.3.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 | cc7b295533b4b9081f2a05f183e79c69f8341d3b30ee7d890171493e067b3d8c |
|
MD5 | 60a064a29974153446f1008834277a73 |
|
BLAKE2b-256 | 542040e7b951beaf05936817ca79deee75cd9f507d45574f4f81ddc2fd90cfc4 |
File details
Details for the file multi_validator_generator-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: multi_validator_generator-0.0.3-py3-none-any.whl
- Upload date:
- Size: 20.5 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 | b4dbed6e0ab821c381da52a0d1a6ee66ba5b47eea7030b84e401d21ee60ea1d8 |
|
MD5 | 920894d3a270e8ea20ec49827b072a4f |
|
BLAKE2b-256 | f65603df9715cbc80d88bbc523c92480786748ca263d0df4950704207221b2fb |