Skip to main content

Brazilian document validator (CPF or CNPJ) using the check digit

Project description

validdocbr

  • Document validator (CPF or CNPJ) based on the verification digit.

Installation:

pip install validdocbr   
pip3 install validdocbr   

Usage:

  • Send a CNPJ or CPF as a string, it can contain special characters, returns True if the document is valid or False if it is invalid, using the check digits for the conference.

Example:

from validdocbr import validdocbr
validator = validdocbr.validdocbr()

cpf = "12345678912"    
cnpj = "98765432112345"    

validator.cpf (cpf) ---> to validate CPF      
validator.cnpj (cnpj) ---> to validate CNPJ     

answer = False ---> the document is invalid      
answer = True ---> the document is valid      


validdocbr

  • Validador de documentos (CPF ou CNPJ) com base no digito verificador.

Istalação:

pip install validdocbr
pip3 install validdocbr

Utilização:

  • Ennvie um CNPJ ou CPF como string, pode conter caracteres especiais, retorna True se documento for válido ou False caso seja inválido, utilizando os digitos verificadores para conferencia.

Exemplo:

from validdocbr import validdocbr

validator = validdocbr.validdocbr()   

cpf = "12345678912"      
cnpj = "98765432112345"     

validador.cpf(cpf) ---> para validar CPF      
validador.cnpj(cnpj) ---> para validar CNPJ      

resposta = False ---> caso documento seja inválido      
reposta = True ---> caso docmunto seja válido     

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

validdocbr-1.0.4.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

validdocbr-1.0.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file validdocbr-1.0.4.tar.gz.

File metadata

  • Download URL: validdocbr-1.0.4.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for validdocbr-1.0.4.tar.gz
Algorithm Hash digest
SHA256 1281f4fd194a0939a042d7469173d30aa4cb02306ab3c1af33cd70c3b9d19242
MD5 0fed77225b73dcdd460161cb484d9a9c
BLAKE2b-256 9a342967fb26c1fa9ddc60c3fe3e7fe8123afe0599e92c785ca145451ea47e31

See more details on using hashes here.

Provenance

File details

Details for the file validdocbr-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: validdocbr-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for validdocbr-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ab92b28c8fe9a91a384a06e6c2574d7ca1a1b800ba7c29627dbc664c8babd349
MD5 30ed34941f2792c23cee84e02ab4b921
BLAKE2b-256 a3e1f7dbde79bce70c6f3ee8e1473d8036a890d1c7b1c5553888148355d9f8ac

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page