Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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

Project Description

Homepage: http://marshmallow-validators.rtfd.org/

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

Documentation

Full documentation is available at http://marshmallow-validators.rtfd.org/ .

License

MIT licensed. See the bundled LICENSE file for more details.

Release History

Release History

This version
History Node

2.0.0

History Node

1.0.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
marshmallow_validators-2.0.0-py2.py3-none-any.whl (7.7 kB) Copy SHA256 Checksum SHA256 3.4 Wheel Dec 29, 2015
marshmallow-validators-2.0.0.tar.gz (9.9 kB) Copy SHA256 Checksum SHA256 Source Dec 29, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting