A Brazilian CPF manipulator package
Project description
cpf_playground
Description
The package cpf_playground is used to: - Generate CPFs (randomly or from staring first 9 digits) - Formatting, adding or removing "-" and "." characters - Validates formatted or raw CPF numbers
installation
Use the package manager pip to install cpf_playground
pip install cpf_playground
Usage
Validating a raw CPF number
from cpf_playground.validation import validate_cpf
cpf = "12345678909"
validate_cpf(cpf) # True or false, according to the number
Validating a formatted CPF number
from cpf_playground.validation import validate_cpf
cpf = "123.456.789-09"
validate_cpf(cpf) # True or false, according to the number
Creating a new random and valid CPF number
from cpf_playground.generation import create_cpf
cpf = create_cpf() # returns a valid CPF number
Creating a valid CPF number from 9 initial digits
from cpf_playground.generation import create_from_9_digits
first_9_digits = "123456789"
cpf = create_from_9_digits(first_9_digits) # returns a valid CPF number
Formatting a raw CPF number into a string with "-" and "." characters
from cpf_playground.formatting import fromat_cpf_from_raw
raw_cpf = "12345678909"
cpf = fromat_cpf_from_raw(raw_cpf) # Returns a formatted CPF, like 123.456.789-09
Formatting a raw CPF number into a string with "-" and "." characters
from cpf_playground.formatting import fromat_cpf_to_raw
cpf = "123.456.789-09"
raw_cpf = fromat_cpf_to_raw(cpf) # Returns a raw CPF, like 12345678909
Author
bernard_clint
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cpf_playground-0.0.1.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cpf_playground-0.0.1.tar.gz.
File metadata
- Download URL: cpf_playground-0.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85fca0a3fc3b565cb892de383cb9f06b0953f0fe5bce65a8642a424e51919820
|
|
| MD5 |
43d8d19df5c57f034ef2573acae1084b
|
|
| BLAKE2b-256 |
d1cf62103d079b6a325f43d2a8da39128127232dd4de891d24d7ba4b5549e81f
|
File details
Details for the file cpf_playground-0.0.1-py3-none-any.whl.
File metadata
- Download URL: cpf_playground-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd028dbd1f40f2a5f2a9e99f697c4c36d36d19f302c12b942b430a1ed9a811f1
|
|
| MD5 |
a421a58595d846cea23377bd1af71280
|
|
| BLAKE2b-256 |
659e2b6fadf2b0ea087fcbf5935c16d87533204019db9746b595e89c81879dd5
|