Skip to main content

Use 3rd-party validators (e.g. from WTForms and colander) with marshmallow

Project description

Latest version Travis-CI marshmallow 3 compatible


Use 3rd-party validators (e.g. from WTForms and colander) with marshmallow.

from marshmallow import Schema, fields
from marshmallow_validators.wtforms import from_wtforms
from wtforms.validators import Email, Length

# Leverage WTForms il8n
locales = ['de_DE', 'de']

class UserSchema(Schema):
    email = fields.Str(
        validate=from_wtforms([Email()], locales=locales)
    password = fields.Str(
        validate=from_wtforms([Length(min=8, max=300)], locales=locales)

UserSchema().validate({'email': 'invalid', 'password': 'abc'})
# {'email': ['Ungültige Email-Adresse.'],
# 'password': ['Feld muss zwischen 8 und 300 Zeichen beinhalten.']}

Get It Now

$ pip install -U marshmallow-validators


Full documentation is available at .


MIT licensed. See the bundled LICENSE file 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 marshmallow-validators, version 3.0.0
Filename, size File type Python version Upload date Hashes
Filename, size marshmallow_validators-3.0.0-py2.py3-none-any.whl (4.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size marshmallow-validators-3.0.0.tar.gz (9.6 kB) File type Source Python version None Upload date Hashes View

Supported by

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