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.

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.0.tar.gz (15.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: fgslpycnpj-1.0.0.tar.gz
  • Upload date:
  • Size: 15.1 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.0.tar.gz
Algorithm Hash digest
SHA256 89586a92d2e57ce2a835c1188296aeef83300d018a64a4a2277472af23ab006a
MD5 c4222bf32377223f96ee4ad996bf46c4
BLAKE2b-256 58aaef9730be12b33e56bd49d926f4920dbd8e4110a07b914e30c67008b782a7

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