Skip to main content

This Python module validates and formats CPF numbers, ensuring they are correct and follow the standard Brazilian format.

Project description

CPFPY

This Python module provides tools for validating and formatting CPF numbers.

Installation

To install, you can use pip:

pip install cpfpy

Usage

Validation

from cpfpy import validate_cpf

cpf = "123.456.789-09"
if validate_cpf(cpf):
    print("Valid CPF!")
else:
    print("Invalid CPF.")

Formatting

from cpfpy import format_cpf

cpf = "12345678909"
formatted_cpf = format_cpf(cpf)
print(formatted_cpf)  # Output: 123.456.789-09

License

MIT

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

cpfpy-0.0.1.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

cpfpy-0.0.1-py3-none-any.whl (3.2 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