https://github.com/marshmallow-code/marshmallow-validators
Use 3rd-party validators (e.g. from WTForms and colander) with marshmallow
https://github.com/marshmallow-code/marshmallow-validators
colander deserialization marshmallow serialization validation wtforms
Last synced: 11 months ago
JSON representation
Use 3rd-party validators (e.g. from WTForms and colander) with marshmallow
- Host: GitHub
- URL: https://github.com/marshmallow-code/marshmallow-validators
- Owner: marshmallow-code
- License: mit
- Created: 2015-08-30T21:06:23.000Z (over 10 years ago)
- Default Branch: dev
- Last Pushed: 2021-05-10T05:22:25.000Z (almost 5 years ago)
- Last Synced: 2024-10-30T00:00:14.465Z (over 1 year ago)
- Topics: colander, deserialization, marshmallow, serialization, validation, wtforms
- Language: Python
- Homepage: https://marshmallow-validators.readthedocs.io
- Size: 53.7 KB
- Stars: 23
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
**********************
marshmallow-validators
**********************
.. image:: https://badgen.net/pypi/v/marshmallow-validators
:target: https://pypi.org/project/marshmallow-validators/
:alt: PyPI version
.. image:: https://badgen.net/travis/marshmallow-code/marshmallow-validators/dev
:target: https://travis-ci.org/marshmallow-code/marshmallow-validators
:alt: TravisCI build status
.. image:: https://badgen.net/badge/marshmallow/2,3?list=1
:target: https://marshmallow.readthedocs.io/en/latest/upgrading.html
:alt: marshmallow 2/3 compatible
Homepage: https://marshmallow-validators.readthedocs.io/
Use 3rd-party validators (e.g. from WTForms and colander) with marshmallow.
.. code-block:: python
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 https://marshmallow-validators.readthedocs.io/ .
Project Links
=============
- Docs: https://marshmallow-validators.readthedocs.io/
- Changelog: https://marshmallow-validators.readthedocs.io/en/latest/changelog.html
- PyPI: https://pypi.python.org/pypi/marshmallow-validators
- Issues: https://github.com/marshmallow-code/marshmallow-validators/issues
License
=======
MIT licensed. See the bundled `LICENSE `_ file for more details.