Skip to main content

Componente Python para validar CNPJ e gerar dígito verificador

Project description

fgslpycnpj

Componente Python para validar CNPJ e calcular o dígito verificador para o novo padrão Alfanumérico definido pela Instrução Normativa nº 2.229.

Este componente está documentado em português porque CNPJ é um identificador que só faz sentido no Brasil.

Are you not understanding this documentation? Learn portuguese or use a translator.

Como instalar

pip install fgslpycnpj

Usando o componente

Validando o CNPJ

$ python
>>> from fgslpycnpj.cnpj.CNPJ import CNPJ
>>> numero = "12.ABC.345/01DE-35"
>>> cnpj = CNPJ(numero)
>>> print(cnpj.valida())

Calculando o dígito verificador

$ python
>>> from fgslpycnpj.cnpj.DigitoVerificador import DigitoVerificador
>>> base = "12.ABC.345"
>>> dv = CNPJ(base)
>>> print(dv.gera_dv())

Para desenvolvedores

  • PKG-INFO descreve o pacote de uma forma resumida.
  • MANIFEST.in define quais arquivos serão incluídos dentro do pacote.
  • pyproject.toml define a informação de empacotamento geral.

Execute os testes

python -m unittest tests/cnpjtest.py 

Construa o pacote

python -m build --sdist .

Requer o módulo build. Você pode instalá-lo usando pip install build.

Atualize o pacote para o to PyPI

twine upload dist/*

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

fgslpycnpj-1.0.1.tar.gz (15.2 kB view details)

Uploaded Source

File details

Details for the file fgslpycnpj-1.0.1.tar.gz.

File metadata

  • Download URL: fgslpycnpj-1.0.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.26.0 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for fgslpycnpj-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1a172e1f4d9bab2b9512f3033d0aa8a1a52c77caf121666c7776f369c1a6ca31
MD5 fc2120996f835e4489b4814fb3bf872a
BLAKE2b-256 72088b292e9e4250d4631e40919a6b2acabe8ddfe6a6a1f4bff894d2897fcc3c

See more details on using hashes here.

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