#!/usr/bin/env python3

""Password Trength Checker""

import re
import pyperclip

# Regexes

pass_length_regex = re.compile(r'.{8,}')       # >= 8 characters
pass_upper_regex = re.compile(r'[A-Z]')        # Contains an upper case letter
pass_lower_regex = re.compile(r'[a-z]')        # Contains a lower case letter
pass_digit_regex = re.compile(r'[0-9]')        # Contains a digit

# Regex checker
def pass_strength_checker(text):
    ""Check password strength""
    if pass_length_regex.search(text) is None:
        return False
    if pass_upper_regex.search(text) is None:
        return False
    if pass_lower_regex.search(text) is None:
        return False
    if pass_digit_regex.search(text) is None:
        return False
    else:
        return True


# Password retrieval
password = str(pyperclip.paste())

# Function check/Print
if pass_strength_checker(password) is True:
    print('Good password, go ahead and use it')
else:
    print('Weak Ass password, try again')
