Skip to main content

Simple and flexible model validator for Peewee ORM.

Project description

A simple and flexible model and data validator for Peewee ORM.

Build Status Code Coverage Version Downloads Documentation


  • python >= 3.3
  • peewee >= 2.8.2 (including Peewee 3)
  • python-dateutil >= 2.5.0


This package can be installed using pip:

pip install peewee-validates


Here’s a quick teaser of what you can do with peewee-validates:

import peewee
from peewee_validates import ModelValidator

class Category(peewee.Model):
    code = peewee.IntegerField(unique=True)
    name = peewee.CharField(null=False, max_length=250)

obj = Category(code=42)

validator = ModelValidator(obj)


# {'name': 'This field is required.', 'code': 'Must be a unique value.'}

In fact, there is also a generic validator that does not even require a model:

from peewee_validates import Validator, StringField

class SimpleValidator(Validator):
    name = StringField(required=True, max_length=250)
    code = StringField(required=True, max_length=4)

validator = SimpleValidator(obj)
validator.validate({'code': 'toolong'})


# {'name': 'This field is required.', 'code': 'Must be at most 5 characters.'}


Check out the Full Documentation for more details.

Project details

Download files

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

Files for peewee-validates, version 1.0.7
Filename, size File type Python version Upload date Hashes
Filename, size peewee_validates-1.0.7-py2.py3-none-any.whl (11.2 kB) File type Wheel Python version 3.6 Upload date Hashes View
Filename, size peewee-validates-1.0.7.tar.gz (10.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page