Skip to content

carlos-moreno/pycnpj-cpf

Repository files navigation

Python CNPJ/CPF

CI

Python CNPJ/CPF is a library created to validate the entered value, indicating whether it is a valid CNPJ or CPF.

Installation

pip install pycnpj-cpf

Usage in CLI mode

$ #verify CNPJ
$ pycnpj-cpf validate --value="37.538.534/0001-86"
$
$ pycnpj-cpf validate --value="37538534000186"
$ #verify CPF
$ pycnpj-cpf validate --value="237.491.140-30"
$
$ pycnpj-cpf validate --value="23749114030"
$

Usage in Python file

>>> from pycnpj_cpf.core import cnpj_or_cpf_is_valid
>>> 
>>> cnpj_or_cpf_is_valid("31.851.707/0001-35")
True
>>>
>>> cnpj_or_cpf_is_valid("492.711.290-08")
True
>>>
>>> cnpj_or_cpf_is_valid("49271129008")
True
>>>
>>> cnpj_or_cpf_is_valid("31851707000135")
True
>>>
>>> cnpj_or_cpf_is_valid("31.851.707/0001-40")
False
>>> 
>>> cnpj_or_cpf_is_valid("31.851.707/000140")
False
>>> 
>>> cnpj_or_cpf_is_valid("31.851.707/0001-40a")
False
>>> 
>>> cnpj_or_cpf_is_valid("31.851.707/0001-40 ")
False
>>> 
>>> cnpj_or_cpf_is_valid("37538026000106")
True
>>> 
>>> cnpj_or_cpf_is_valid("37538036000106")
False
>>>

About

CNPJ and CPF validator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published