Python form generation / validation libraries

I am a Python developer, coming from a PHP background. In PHP, most frameworks included a decent API for creating / validating forms (Zend and CakePHP come to mind). In my new company, we try to stay away from Django and make extensive use of Werkzeug.

I looked at FormEncode and Formular. Formal seems to me better, but it must be material that my noobie brain does not know about. Please enlighten me.

+6
python validation forms code-generation
source share
2 answers

There's also WTForms , which is a pretty minimal form library that goes well with Werkzeug.

+3
source share

FormEncode is more of a validation library and not very good at creating forms.

Personally, I don't like to mix output (forms) and validation. As I see some of the shortcomings in FormEncode that they tried to remove in my own implementation called pycerberus . However, it does not generate any images at all.

The reason I don't like sharing html generation + validation is this:

  • I also need verification in non-ui contexts such as server applications, libraries, and I do not want to switch libraries, but support one set of tools.
  • There are very good tools for generating output, and I would like to choose the one that suits me best. If I need extra functionality, the choice is really limited.
+1
source share

All Articles