Skip to main content

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

Build Status Code Coverage Version Downloads Documentation

Requirements

  • python >= 3.3

  • peewee >= 2.8.2 (including Peewee 3)

  • python-dateutil >= 2.5.0

Installation

This package can be installed using pip:

pip install peewee-validates

Usage

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)
validator.validate()

print(validator.errors)

# {'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'})

print(validator.errors)

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

Documentation

Check out the Full Documentation for more details.

Metadata

Release files for peewee-validates 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peewee-validates 1.0.7
File Size Uploaded Provenance
peewee-validates-1.0.7.tar.gz 10.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for peewee-validates 1.0.7
File Interpreter ABI Platform
peewee_validates-1.0.7-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 21.7 kB

Release files / peewee-validates-1.0.7.tar.gz

Download URL peewee-validates-1.0.7.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8207de77a7482229a68380a4a9af95e0ddbfa0b27464ca0f542d5b2e469c1a55
BLAKE2b-256 checksum
How to use checksums
f9c34beba6c4780046d434200513f322c60334182aac94a5983ae27d508392e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / peewee_validates-1.0.7-py2.py3-none-any.whl

Download URL peewee_validates-1.0.7-py2.py3-none-any.whl
Size 11.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
be9b31821f4204be01672db72bee63c359f68cfa543cabb7c6e89b2250ddfc9b
BLAKE2b-256 checksum
How to use checksums
aaed6165cffefac66d286689ba70e96d0f6694e505dc6ae98c9b22af73ac3c43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for peewee-validates 1.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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