Skip to main content

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)

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)

Source distribution for shucks 1.2.1
File Size Uploaded
shucks-1.2.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shucks 1.2.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.0

2 release files

0.4.0

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page