Skip to main content

This npm package provides JavaScript functions to generate valid Brazilian CPF (Cadastro de Pessoas Físicas) and CNPJ (Cadastro Nacional da Pessoa Jurídica) numbers.

Project description

cpf_and_cnpj-generator

PyPI version License: MIT PyPI downloads

This package provides Python functions to validate various forms fields.

Documentation: https://gabriel-logan.github.io/cpf_and_cnpj-generator/documentation/py

Feel free to find bugs and report them to me. Your feedback is highly appreciated. Hugs from Gabriel Logan!

If you want to help me, you can buy me a coffee (:

Buy Me A Coffee

Installation

pip install cpf_and_cnpj-generator

Avaliable Functions

  • cnpjValidator: CNPJ validation.
  • cpfValidator: CPF validation.

Usage

Here is an example of how to use the functions in this package:

from multiform_validator import (
    cnpjIsValid,
    cpfIsValid,
)
print("Is email", isEmail("foo@bar.com")) # True
print("Get only email", getOnlyEmail("awdawd wadawd wda awd jhony@gmail.com awdawdawd")) # jhony@gmail.com
print("Password strength", passwordStrengthTester("aA1!asd@qd2asd")) # Strong
print("Is CPF valid", cpfIsValid("123.456.789-02")['isValid']) # False
print("Is CNPJ valid", cnpjIsValid("12.345.678/0001-09")) # { 'isValid': False, 'errorMsg': 'CNPJ is not valid' }
print("Is credit card valid", isCreditCardValid("5117 2161 1334 8362")) # True
print("Identify flag card", identifyFlagCard("5117 2161 1334 8362")) # Mastercard
print("Validate BR phone number", validateBRPhoneNumber("(11) 91234-5678")) # { 'isValid': True, 'errorMsg': None }

Feel free to explore the various functions and experiment with different inputs to understand their behavior. If you encounter any issues or have suggestions, don't hesitate to reach out to me. Your feedback is valuable and helps improve the package. Happy coding!

By - Gabriel Logan

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

cpf_and_cnpj_generator-0.0.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

cpf_and_cnpj_generator-0.0.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

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