Skip to main content

Brazilian CPF Tester

Project description

br-cpf-tester This is a test implementatipon of the Brazilian CPF Validation as part of the “Mão na Massa” proposal of the 4th module of Welcome to the Django training (

CPF is a document that identifies a taxpayer at the Federal Internal Revenue Department. The CPF carries registration information supplied by the individual and by the Federal Internal Revenue Department database.

This number is currently formated as XXX.XXX.XXX-DD where X are digits and D are check digits. Code Health

Como desenvolver?

  1. Clone o repositório
  2. Crie um virtualenv com Python 3.6.
  3. Ative o virtualenv.
  4. Instale as dependências
  5. Execute os testes
git clone python brcpf
cd brcpf
python -m venv .brcpf
source .brcpf/bin/activate
pip install -r requirements.txt

Como instalar?

pip install br-cpf-tester

Como utilizar dentro de um no django?

from django.core.exceptions import ValidationError
from brcpftester import BrazilianCpfValidationTests

def validate_cpf(value):
    cpf = BrazilianCpfValidationTests()
    for test in cpf.tests:
        raise ValidationError(cpf.GetMessage(test), test)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for br-cpf-tester, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size br-cpf-tester-0.1.4.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page