Frameworks and Tools

We attempt to use the same set of frameworks and tools across projects to minimize the number of frameworks developers must keep in their heads.

Python

Flask

Flask is a web microframework for Python based on Werkzeug and Jinja 2. It is our preferred framework and all new applications should use it unless there is a very good reason not to do so.

For historical reasons, you may find applications that don’t use Flask. Other frameworks currently in use include Django and Pyramid.

Flask is designed to be extensible, so it’s common to use extensions with the core flask library. A few common extensions are documented below.

Flask-SQLAlchemy

Flask-SQLAlchemy integrates Flask with SQLAlchemy. It will configure a scoped session for you, set up a declarative base class, and provide a convenient flask_sqlalchemy.BaseQuery sub-class for you.

SQLAlchemy Helpers

SQLAlchemy-Helpers is an alternative to using Flask-SQLAlchemy if you need your models to be usable from outside Flask.

SQLAlchemy

SQLAlchemy is an SQL toolkit and Object Relational Mapper. It provides a core set of tools (surprisingly called SQLAlchemy Core) for working with SQL databases, as well as an Object Relational Mapper (SQLAlchemy ORM) which is built using SQLAlchemy Core.

SQLAlchemy is quite flexible and provides a myriad of options. We use SQLAlchemy with its Declarative extension to map SQL tables to Python classes. Once mapped, instances of those Python classes are created from database rows using the Session interfaces.