Installing
pip3 install shucks
Simple Usage
Validating a login form accepting email or phone and a password.
import shucks
import math
schema = shucks.And(
dict,
{
'id': shucks.If(
shucks.And(str, lambda v: '@' in v),
shucks.Con(
lambda v: v.split('@', 1)[1],
shucks.contain({'gmail.com', 'hotmail.com', 'yahoo.com'})
),
shucks.And(
shucks.Or(str, int),
shucks.Con(str, shucks.Con(len, shucks.range(10, 10)))
)
),
'password': shucks.And(
str,
shucks.Con(len, shucks.And(shucks.range(8, math.inf))),
shucks.wrap(shucks.Not(lambda v: 'logo' in v), 'logo')
),
shucks.Opt('remember'): bool
}
)
data = {
'id': 1234567890
'password': 'logo1234'
}
shucks.check(schema, data)
Links
Metadata
Release files for shucks 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| shucks-1.2.1.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| shucks-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.1 kB
Release files / shucks-1.2.1.tar.gz
| Download URL | shucks-1.2.1.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5530b8475706e653455615b59a7e1991bb2d172a75b46216e527dd41ef7829e3
|
|
BLAKE2b-256 checksum How to use checksums |
ad2e49870fefd09666d33aa127a71c407fabef219ae60073076cf2677d175a30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0
|
Release files / shucks-1.2.1-py3-none-any.whl
| Download URL | shucks-1.2.1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e6f4ac791d76abde5ae2e9aa6e298e012980e347dd49c09ff39def34e9ab12a
|
|
BLAKE2b-256 checksum How to use checksums |
f5f8282362654d3881108fcefe213b89db482bf09bb88f898bab8c0f241a1833
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0
|