The package objective is to mischaracterize sensitive data from this through blinding masks using asterisk
Project description
STARRO
Starro is a facilitator to overshadow sensitive information.
It reduces the brain overload inherent in the Regex complexity, bringing several commands closer to human language.
how to install?
Pip:
pip install starro
Poetry:
poetry add starro
how it works?
Basic usage
from starro import starro
password = "MyP@ssW0r$"
print(starro.password(password))
#prints: **********
token = "3hjsdf67kajh8990s5dff0lk5sdfsfhjks8923"
print(starro.secret(token))
#prints: **************************************
fullname = "Marcos Monteiro Borges"
print(starro.name(fullname))
#prints: M***** M******* B*****
mail = "contato@marcosborges.com "
print(starro.mail(mail))
#prints: c******@marcosborges.com
phone = "+55 (11) 9999-9999"
print(starro.phone(phone))
#prints: "+** (**) ****-9999"
creditcard = "6666-0000-8888-3232"
print(starro.creditcard(creditcard))
#prints: "6666-****-****-3232"
cpf = "313.789.874-45"
print(starro.cpf(cpf))
#prints: "313.***.***-45"
rg = "34.275.057-4"
print(starro.rg(rg))
#prints: "34.***.***-4"
# Others examples
assert starro.complete("1234567890") == "**********"
assert starro.mask_left("Testing mask left", 3) == "***ting mask left"
assert starro.mask_right("Testing mask right", 3) == "Testing mask ri***"
assert starro.fix_left("Testing fix left", 3) == "Tes*************"
assert starro.fix_right("Testing fix right", 3) == "**************ght"
assert starro.mask_center('completeds', 5) == 'com*****eds'
assert starro.mask_center('completeds', 12) == '**********'
assert starro.fix_center('complete', 4) == '**mple**'
assert starro.fix_center('complete', 12) == '********'
Decorator usage
from starro.starro import starrofy
class MyClass:
@property
@starrofy('name')
def fullname(self):
return self._fullname
@property
@starrofy('phone')
def phone(self):
return self._phone
@property
@starrofy('email')
def mail(self):
return self._email
@property
@starrofy('password')
def password(self):
return self._password
myClass = MyClass()
myClass.fullname = "Full Name User"
myClass.phone = "+55 11 99999-9999"
myClass.cpf = "313.313.313-32"
myClass.mail = "contato@marcosborges.com"
myClass.creditcard = "2080-1408-0210-3005"
print("fullname:" + myClass.fullname + "\n")
print("phone:" + myClass.phone + "\n")
print("cpf:" + myClass.cpf + "\n")
print("mail:" + myClass.mail + "\n")
print("creditcard:" + myClass.creditcard + "\n")
What are the dependencies?
- Core
- python = "^3.6"
- re
- math
- python = "^3.6"
- Develop
- pytest = "^6.2.2"
- coverage = "^5.5"
- pylint = "^2.7.2"
- bandit = "^1.7.0"
- flake8 = "^3.9.0"
- dependency-check = "^0.5.0"
QualityGate
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
starro-1.0.10.tar.gz
(5.8 kB
view hashes)