You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1dfa064
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.rst
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,9 @@ validators
3
3
4
4
Python data validation for Humans.
5
5
6
-
7
-
Python has all kinds of data validation tools, but every one of them seems to require defining a schema / form. I wanted to create a simple validation library where validating a simple value does not require defining a form or a schema.
6
+
Python has all kinds of data validation tools, but every one of them seems to
7
+
require defining a schema / form. I wanted to create a simple validation library
8
+
where validating a simple value does not require defining a form or a schema.
Copy file name to clipboardExpand all lines: docs/index.rst
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,14 @@ Python Data Validation for Humans™.
7
7
Why?
8
8
====
9
9
10
-
Python has all kinds of validation tools, but every one of them requires defining a schema. I wanted to create a simple validation library where validating a simple value does not require defining a form or a schema. Apparently some other guys have felt the same way: http://opensourcehacker.com/2011/07/07/generic-python-validation-frameworks/
10
+
Python has all kinds of validation tools, but every one of them requires
11
+
defining a schema. I wanted to create a simple validation library where
12
+
validating a simple value does not require defining a form or a schema.
13
+
Apparently some other guys have felt the same way:
Often I've had for example a case where I just wanted to check if given string is an email. With `validators` this use case becomes as easy as:
16
+
Often I've had for example a case where I just wanted to check if given string
17
+
is an email. With `validators` this use case becomes as easy as:
13
18
14
19
::
15
20
@@ -36,9 +41,13 @@ Currently validators supports python versions 2.6, 2.7 and 3.3.
36
41
Basic validators
37
42
================
38
43
39
-
Each validator in `validators` is a simple function that takes the value to validate and possibly some additional key-value arguments. Each function returns `True` when validation succeeds and ValidationFailure object when validation fails.
44
+
Each validator in `validators` is a simple function that takes the value to
45
+
validate and possibly some additional key-value arguments. Each function returns
46
+
`True` when validation succeeds and ValidationFailure object when validation
47
+
fails.
40
48
41
-
ValidationFailure class implements __bool__ method so you can easily check if validation failed:
49
+
ValidationFailure class implements __bool__ method so you can easily check if
50
+
validation failed:
42
51
43
52
::
44
53
@@ -48,7 +57,8 @@ ValidationFailure class implements __bool__ method so you can easily check if va
48
57
pass
49
58
50
59
51
-
ValidationFailure object also holds all the arguments passed to original function:
60
+
ValidationFailure object also holds all the arguments passed to original
0 commit comments