Skip to main content

Library for generation, validation and formatting of Brazilian data (CPF, CNPJ, RG, CEP, CNH, etc.)

Project description

brutils_py

brutils_py is a Python library for the generation, validation, and formatting of common Brazilian data used in documents, systems, and forms. It includes tools for working with CPF, CNPJ, RG, CNH, CEP, phone numbers, vehicle plates, and more.

It also offers integration with the ViaCEP API to verify the existence of a given CEP in real time.


Features

  • Generate and validate CPF (Cadastro de Pessoas Físicas)
  • Generate and validate CNPJ (Cadastro Nacional da Pessoa Jurídica)
  • Generate and validate RG (Registro Geral)
  • Generate and validate CNH (Carteira Nacional de Habilitação)
  • Generate, validate, and format CEP (Código de Endereçamento Postal)
  • Check existence of CEP via ViaCEP API
  • Generate and validate Título de Eleitor
  • Generate and validate PIS and NIS numbers
  • Generate and validate Brazilian phone numbers (mobile and landline)
  • Generate and validate vehicle license plates (Mercosul and legacy formats)

Installation

Install the library via pip:

pip install brutils_py

Note: This package requires Python 3.12 or higher.

Development

To run tests locally, install the development dependencies:

pip install -e .[dev]
pytest

License

This project is licensed under the MIT License. See LICENSE for more information.

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

brutils_py-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brutils_py-0.1.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file brutils_py-0.1.0.tar.gz.

File metadata

  • Download URL: brutils_py-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for brutils_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 66287297ce88ff3f72c027168781aa1d69077baa0f1608bf0f1e7ea6c1369633
MD5 2a6867db2b388994eea1162904fbfe0e
BLAKE2b-256 970fede1dd4cb8f93fb687e8f4338918f25b49185422cef04bf9b6e6f665029d

See more details on using hashes here.

File details

Details for the file brutils_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: brutils_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for brutils_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0be318e6870ffe14de39e3ed248f42987e5ef2e300da36a541d275c48b464341
MD5 b0441fc128d37cb7ca0797fb4b4d9183
BLAKE2b-256 1f5ebf03a44ed63866776894e29aba97cc1ab4b43fef247de8378d69fb706765

See more details on using hashes here.

Supported by

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