skip to navigation
skip to content

vm-cpf-validator 0.0.6

This package contains three modules that validates the Brazilian CPF

CPF Validator

This package contains four modules three to validate a Brazilian CPF and one to format in correct form the Brazilian
CPF. Each of modules can be used separately.

Install

pip install vm-cpf-validator

Usage

from vm_cpf_validator import cpf_is_digits, cpf_has_correct_length, cpf_is_valid, format_cpf

After import the package, follow the instructions for each function below:

1. cpf_is_digits

This first module receives the Brazilian CPF and returns True if it contains only digits or False if not.

The syntax to use this function is:

if cpf_is_digits(value):
    print('The only contains digits')
else:
    print('The value do not contains only digits, please type it only digits')

2. cpf_has_correct_length

This second module receives the Brazilian CPF and returns True if the length of CPF is 11 or False if not.

The syntax to use this function is:

if cpf_has_correct_length(value):
    print('The contains 11 digits')
else:
    print('The value do not contains 11 digits, please type it a correct length of digits')

3. cpf_is_valid

This third module receives the Brazilian CPF and returns True if the CPF is valid or False if not valid.

The syntax to use this function is:

if cpf_is_valid(value):
    print('The CPF is valid')
else:
    print('The CPF is not valid, please type it a valid CPF')

4. format_cpf:

This fourth module receives the Brazilian CPF numbers as 12345678911 and returns the valid format as 123.456.789-11.

The syntax to use this function is:

>>>print(format_cpf('12345678911'))
123.456.789-11
 
File Type Py Version Uploaded on Size
vm_cpf_validator-0.0.6-py3-none-any.whl (md5) Python Wheel py3 2017-08-02 3KB
vm_cpf_validator-0.0.6.tar.gz (md5) Source 2017-08-02 3KB