Skip to main content

A simple schema builder for value parsing and validation

Project description

PyYep

PyYep is a python schema builder for value parsing and validation. Define a schema, transform a value to match and validate the inputs with existing validator or custom functions.

PyYep is heavily inspired by Yup

Docs

Install

pip install PyYep

Usage

You define and create schema objects with its inputs and validation methods. Then use the verify method to check the schema. A ValidationError will be raised if some input value does not match the validation.

from PyYep import Schema, InputItem, ValidationError

schema = Schema([
	InputItem('name', input_object, 'path-to-input_object-value-property-or-method').string().email(),
	InputItem('name', input_object, 'path-to-input_object-value-property-or-method').number().min(10).max(100),
], abort_early=False) 

// check validity

try:
	result = schema.validate()
	# handle result
except ValidationError:
	# handle fail

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyYep-0.0.4.dev0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyYep-0.0.4.dev0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file PyYep-0.0.4.dev0.tar.gz.

File metadata

  • Download URL: PyYep-0.0.4.dev0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for PyYep-0.0.4.dev0.tar.gz
Algorithm Hash digest
SHA256 98669de7af8662014e9988ba82ebd1fde5a5d1c9799afd97eac4b573d9d230b1
MD5 dd6f5a1811470caf7663f4727065ee4a
BLAKE2b-256 667e9ed4b8fb275b29bbc2d73672e3a0ddb562cc78cf4dc3d3cc848be44dcda4

See more details on using hashes here.

File details

Details for the file PyYep-0.0.4.dev0-py3-none-any.whl.

File metadata

  • Download URL: PyYep-0.0.4.dev0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for PyYep-0.0.4.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 8828cc79f28dded7c05ea5b9a1362bcb02b1ce6088dcc0a2bcf52ba419b490f4
MD5 b32f8cb09d2da8168d6a66d73f932146
BLAKE2b-256 fc2770ce9f542e1bf293a6937cd57fc00318b302b7b1c6a3c826af33977a49c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page