28 best Python Form Validation libraries in 2023
by weaver Updated: Sep 1, 2021
Guide Kit
Python is an indispensable tool for many programmers. With it, you can do away with all the repetitive and tedious work involved with other scripting languages. For a technical process like form validation, with Python, you can ensure that the input text is in the correct format (including both after submitting and inline validation). Hence, when you build an application that accepts user input, you can verify that the data that enters your application is valid, consistent, and secure with various open-source Python libraries. Here we list down some of those libraries which are useful for form validation. Say, with pydantic, you can define custom data types, parse input data, and then validate it. Using type hints, the library can even coerce input data to the declared types and accumulate errors using ValidationError. pydantic is also easily discoverable given how well it has been documented. Another application, Django-crispy-forms helps you manage Django forms by allowing you to adjust their properties (say, CSS classes, send button, etc.) on the backend. This means you no longer have to rewrite anything in the template. We also have Formspree, which is a backend, API, and email service for HTML and JavaScript forms. It is secure with a honeypot to prevent spam and is the simplest way to embed customized order forms, “Contact Us” forms, and dialogue boxes meant to capture email.
pydanticby samuelcolvin
Data parsing and validation using Python type hints
pydanticby samuelcolvin
Python
9557
Version:v1.9.0
License: Permissive (MIT)
marshmallowby marshmallow-code
A lightweight library for converting complex objects to and from simple Python datatypes.
marshmallowby marshmallow-code
Python
6558
Version:Current
License: Permissive (MIT)
django-crispy-formsby django-crispy-forms
The best way to have DRY Django forms. The app provides a tag and filter that lets you quickly render forms in a div format while providing an enormous amount of capability to configure and control the rendered HTML.
django-crispy-formsby django-crispy-forms
Python
4718
Version:2.0
License: Permissive (MIT)
connexionby zalando
Swagger/OpenAPI First framework for Python on top of Flask with automatic endpoint validation & OAuth2 support
connexionby zalando
Python
3888
Version:2.10.0
License: Others (Non-SPDX)
sqlparseby andialbrecht
A non-validating SQL parser module for Python
sqlparseby andialbrecht
Python
3291
Version:Current
License: Permissive (BSD-3-Clause)
cerberusby pyeve
Lightweight, extensible data validation library for Python
cerberusby pyeve
Python
2989
Version:Current
License: Permissive (ISC)
SublimePrettyJsonby dzhibas
Prettify/Minify/Query/Goto/Validate/Lint JSON plugin for Sublime Text 3 & 4
SublimePrettyJsonby dzhibas
Python
1985
Version:1.3.1
License: Permissive (MIT)
django-widget-tweaksby jazzband
Tweak the form field rendering in templates, not in python-level form definitions. CSS classes and HTML attributes can be altered.
django-widget-tweaksby jazzband
Python
1823
Version:1.4.12
License: Permissive (MIT)
panderaby pandera-dev
A light-weight, flexible, and expressive data validation library for dataframes
panderaby pandera-dev
Python
1240
Version:v0.10.1
License: Permissive (MIT)
wtformsby wtforms
A flexible forms validation and rendering library for Python.
wtformsby wtforms
Python
1386
Version:3.0.1
License: Permissive (BSD-3-Clause)
ohmyformby ohmyform
✏️ Free open source alternative to TypeForm, TellForm, or Google Forms ⛺
ohmyformby ohmyform
Python
2301
Version:1.0.3
License: Strong Copyleft (AGPL-3.0)
django-simple-captchaby mbi
Django Simple Captcha is an extremely simple, yet highly customizable Django application to add captcha images to any Django form.
django-simple-captchaby mbi
Python
1308
Version:Current
License: Permissive (MIT)
django-phonenumber-fieldby stefanfoulis
A django model and form field for normalised phone numbers using python-phonenumbers
django-phonenumber-fieldby stefanfoulis
Python
1332
Version:7.0.2
License: Permissive (MIT)
django-moneyby django-money
Money fields for Django forms and models.
django-moneyby django-money
Python
1412
Version:3.1
License: Others (Non-SPDX)
django-smart-selectsby jazzband
chained and grouped selects for django forms
django-smart-selectsby jazzband
Python
1035
Version:1.6.0
License: Permissive (BSD-3-Clause)
awesome-fraud-detection-papersby benedekrozemberczki
A curated list of data mining papers about fraud detection.
awesome-fraud-detection-papersby benedekrozemberczki
Python
1372
Version:v_0005
License: Permissive (CC0-1.0)
django-recaptchaby praekelt
Django reCAPTCHA form field/widget integration app.
django-recaptchaby praekelt
Python
761
Version:Current
License: Permissive (BSD-3-Clause)
data-validationby tensorflow
Library for exploring and validating machine learning data
data-validationby tensorflow
Python
720
Version:v1.13.0
License: Permissive (Apache-2.0)
pyformsby UmSenhorQualquer
Python layer of Windows forms, based on PyQt and OpenGL
pyformsby UmSenhorQualquer
Python
598
Version:Current
License: Permissive (MIT)
enforceby RussBaz
Python 3.5+ runtime type checking for integration testing and data validation
enforceby RussBaz
Python
544
Version:Current
License: No License
UhOh365by Raikia
A script that can see if an email address is valid in Office365 (user/email enumeration). This does not perform any login attempts, is unthrottled, and is incredibly useful for social engineering assessments to find which emails exist and which don't.
UhOh365by Raikia
Python
571
Version:Current
License: Strong Copyleft (GPL-3.0)
ystockquoteby cgoldberg
Fetch stock quote data from Yahoo Finance
ystockquoteby cgoldberg
Python
504
Version:Current
License: No License
django-formtoolsby jazzband
A set of high-level abstractions for Django forms
django-formtoolsby jazzband
Python
661
Version:Current
License: Permissive (BSD-3-Clause)
validate_emailby syrusakbary
Validate_email verify if an email address is valid and really exists
validate_emailby syrusakbary
Python
481
Version:Current
License: Others (Non-SPDX)
typesystemby encode
Data validation, serialization, deserialization & form rendering. 🔢
typesystemby encode
Python
430
Version:Current
License: Permissive (BSD-3-Clause)