Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

Simple data validation library

Project description

Decent is a data validation library for Python 2 & 3. There are many like it, but this one is mine.

Read the documentation for more details.

Quick example

from decent import *

schema = Schema({
    'name': All(Strip(), NotEmpty()),
    'age': Range(min=0, max=200),
})

try:
    output = schema(input)
    ...
except Invalid as e:
    print('\n'.join(e.messages))
    ...

Thanks

This library takes inspiration from Voluptuous and Good, but doesn’t implement many of their more magical features. You may be interested in them if you find yourself wanting more.

License

MIT, see the LICENSE file.

Project details


Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page