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.3.dev0.tar.gz (5.8 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.3.dev0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: PyYep-0.0.3.dev0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for PyYep-0.0.3.dev0.tar.gz
Algorithm Hash digest
SHA256 ce1bdf6d647924e3575311f80deda78ce31c975f15e931e4571a4dde7e162d3d
MD5 e806023ba4932e6b269dc9c50304cbd4
BLAKE2b-256 c7b6c66552a6966c40e47cf1abae7266385545042de86928e30dd0ae2c9bf3c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyYep-0.0.3.dev0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for PyYep-0.0.3.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c4da0d2dc08767060006d0b5b753a52719f402156574ce9df155d6299b56f4a
MD5 65b9ac3019e1632ee86c8dec322c3cc3
BLAKE2b-256 efcb813c2958229710428589b5fa0893b65131a5dd783cebd70170e1cc15bae5

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