skip to navigation
skip to content

Not Logged In

formbar 0.4.2

Python library to layout, render and validate HTML forms in web applications

Package Documentation

Latest Version: 0.7.0


Formbar is a python library to layout, render and validate HTML forms in web
applications. Formbar renders forms which are compatible with `Twitter
Bootstrap <>`_ styles.

In contrast to many other form libraries forms with formbar are configured in XML
files to separate the form definition form the implementation and handle it as

Formbar is the German word for "shapeable" and should emphasise the
character of formbar which hopefully makes shaping your forms more easy.

Formbar uses a subset of the
`FormAlchemy <>`_ as underlying
library for rendering and basic validation.


* Support for SQLAlchemy mapped items and plain forms.
* Expression bases rules
* Type conversation and validation
* XML based form definition
* i18n Support
* Row and column based layouts
* Different form layouts for the same model (Create, Edit, Read...)
* Twitter bootstrap support
* Custom CSS styling
* Error messages
* Help texts
* Numbering of fields
* Extern defined renderers.
* ...

Getting started
Please refer to formbar documentation for further information how to get
started using formbar.
For all the impatient out there here comes a very comprehensive example code
which should give a glimpse on how things could work for you::

        from formbar.config import Config, load
        from formbar.form import Form
        # Simple rendering here, no data submission
        # nor validation or saving.
        config = Config(load('/path/to/formconfig.xml'))
        form_config = config.get_form('example')
        form = Form(form_config)

The corresponding configuration file might look like this one.::

        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <!-- Define different entity types -->
            <entity id="e1" name="float" label="Float field" type="float">
              <rule expr="$float lt 100" msg="Float must be lower than 100" mode="post"/>
              <help>This is is a very long helptext which should span over
              multiple rows. Further the will check if there are further html
              tags allowed.</help>
            <entity id="e2" name="select" label="Select field" type="string">
              <help>This is my helptext</help>
                <option value="1">Option 1</option>
                <option value="2">Option 2</option>
                <option value="3">Option 3</option>
                <option value="4">Option 4</option>
          <!-- The entities are finally only referenced to layout the form -->
          <form id="example1" css="testcss" autocomplete="off" method="POST" action="" enctype="multipart/form-data">
              <col><field ref="e1"/></col>
              <col><field ref="e2"/></col>

This is a very simple example just to get an impression. There are many more
configuration options. See the examples folder for more information on the
configuration or how the validation works.

Formbar should be well documented and comes with documentation, bunch of
unitests and last but not least an example serve which serve some example

Formbar is Free Software and licensed under GPL version 2.

Project state
Formbar is in a early project state and still in under development including
large design changes. Call it alpha if you want.
File Type Py Version Uploaded on Size
formbar-0.4.2.tar.gz (md5) Source 2013-08-19 593KB
  • Downloads (All Versions):
  • 105 downloads in the last day
  • 494 downloads in the last week
  • 2546 downloads in the last month