1-
21import re
32
43from . import lib
@@ -11,8 +10,10 @@ class PasswordValidator:
1110 Example:
1211 >>> schema = PasswordValidator()
1312 >>> schema.has().letters().has().digits().no().spaces()
13+ <src.password_validator.password_validator.PasswordValidator object at ...>
1414 >>> schema.validate('testPassword123')
1515 True
16+
1617 Returns:
1718 PasswordValidator: Schema object
1819 '''
@@ -30,6 +31,7 @@ def validate(self, pwd):
3031 False
3132 >>> PasswordValidator().letters().validate('abc')
3233 True
34+
3335 Args:
3436 pwd (str): Password to validate against the schema
3537 Returns:
@@ -63,6 +65,7 @@ def has(self, regexp=None):
6365 True
6466 >>> PasswordValidator().has(r'[a-z]+').validate('test')
6567 True
68+
6669 Args:
6770 regexp (str, optional): The regular expression or string to mandate on the password
6871 Returns:
@@ -107,6 +110,7 @@ def uppercase(self):
107110 True
108111 >>> PasswordValidator().uppercase().validate('test')
109112 False
113+
110114 Returns:
111115 PasswordValidator: Updated schema object
112116 '''
@@ -121,6 +125,7 @@ def lowercase(self):
121125 True
122126 >>> PasswordValidator().lowercase().validate('TEST')
123127 False
128+
124129 Returns:
125130 PasswordValidator: Updated schema object
126131 '''
@@ -136,6 +141,7 @@ def letters(self):
136141 True
137142 >>> PasswordValidator().no().letters().validate('test')
138143 False
144+
139145 Returns:
140146 PasswordValidator: Updated schema object
141147 '''
@@ -151,6 +157,7 @@ def digits(self):
151157 False
152158 >>> PasswordValidator().no().digits().validate('test123')
153159 False
160+
154161 Returns:
155162 PasswordValidator: Updated schema object
156163 '''
@@ -166,6 +173,7 @@ def min(self, length):
166173 True
167174 >>> PasswordValidator().min(8).validate('test')
168175 False
176+
169177 Args:
170178 length (int): Minimum length allowed
171179 Returns:
@@ -184,6 +192,7 @@ def max(self, length):
184192 False
185193 >>> PasswordValidator().max(8).validate('test')
186194 True
195+
187196 Args:
188197 length (int): Maximum length allowed
189198 Returns:
@@ -201,6 +210,7 @@ def spaces(self):
201210 True
202211 >>> PasswordValidator().no().spaces().validate('a bc')
203212 False
213+
204214 Returns:
205215 PasswordValidator: Updated schema object
206216 '''
0 commit comments