Flexible Python web forms with asynchronous validation

icook icook Last update: May 07, 2022
https://travis-ci.org/icook/yota.png?branch=masterhttps://coveralls.io/repos/icook/yota/badge.png?branch=master

Yota

Documentation | Example Repository | Demo

Yota is a Python form generation library with the following unique features:

  • Easy integration of realtime validation. Trigger a server side formvalidation with any JavaScript event on your input fields. (Client side inplanning)
  • Dynamic form structures allow for complex forms with on the fly changes.Inject different input fields or validation methods into a specific instanceof your Form where needed.
  • Default themed with Bootstrap, allowing you to quickly throw together usefulforms that look nice.

In addition to these features, Yota also includes most of the features thatyou would see with other form libraries.

  • Simple declarative syntax for defining form validation and layout
  • Customizable template driven schemas
  • Ability to operate with almost any framework and use any rendering engine.(Default is jinja2)

Philosophically Yota aims to have a ton of power, since designing Forms canrequire a lot of flexibility. This was the main problem the designers had withother libraries is that they ended up getting in the way. At the same timehowever it is important that sensible default be easy to use and implement,making the creation of common forms trivial and lowering the inital learningcurve.

Installation

To install Yota just:

  • pip install yota

Or you can install it from Git with:

Tests

Yota tries hard to maintain a high level of test coverage, and as such runningthe tests before pull requests and commits is important. Tests are setup to runwith nose, and some testing parses HTML with beautifulsoup. To install:

  • pip install nose beautifulsoup4

Then run:

  • nosetests

in the root folder of the project.

Get Involved

Any and all contributions to Yota are gladly welcomed. Simply fork therepository and make a pull request with your addition or open an issue for themaintainers to consider. Please include 100% test coverage with all pullrequests. If you're looking to help out, there are several tickets tagged with"maintinance" that should be easy starting point. Adding yourself to theCONTRIBUTORS.txt list when making a pull request is also encouraged.

Latest Changes

0.2.2 (2013-08-22)

Features

  • Added post-success JavaScript hooks for common actions as well as custom JS
  • Shorthand validation is now allowed for dynamically inserted nodes
  • Added Python 3.3 support
  • Implemented a 'validator' method for Form that allows one-off validation forvalidation logic that is specific to that form only
  • Added new 'render_success' and 'error_success' attributes for Form to specifya JavaScript function to replace the default callback in the JS api
  • css_style, disable, and css_class are now Node attributes that can be used intemplates
  • Added a new FileNode for uploading files with along with a MimeTypeValidatorand associated template modifications

Bug Fixes

  • Documentation fixes
  • Setting title=False didn't function correctly
  • Some class attribute override semantics didn't function as intended and havenow been resolved
  • Fixed a unicode encoding error identified by xen that was breaking validation

Maintenance/Stability

  • Moved some functionality out of the metaclass to be more lazy, increasing theinitialization speed of classes and improving testing
  • Wrote many additional tests and significantly improved assertion coverage
  • Completely re-organized tests to be organized less haphazzardly and updated/extended their comments significantly.
  • Setup coveralls and Travis CI
  • Gave the whole codebase a PyLint and PEP8 pass

License

Yota is under the new-style BSD license.

Tags:

Subscribe to our newsletter