Pillars of Python: Pyramid Web framework

Built on the foundation of repoze.bfg, Pyramid is powerfully flexible but takes time to figure out

1 2 3 Page 3
Page 3 of 3

Pyramid: Application decoration
Pyramid provides an unusual approach to application configuration. Rather than simply writing configuration information into a configuration file, you can employ "decoration." Using Python's decorator syntax, you can attach characteristics to an application's functions. The Pyramid framework scans the application source and processes its decorators for use at runtime. These decorators allow you to specify characteristics to functions that will allow the framework -- specifically, the view lookup subsystem -- to determine which "view callable" functions will respond to a given HTTP request. The view lookup subsystem is passed a context resource object and a request object, and from these -- as well as characteristics attached to view callable methods -- it determines which view callable will be executed in response to a given request.

Pyramid boasts a substantial collection of add-in packages. They include an XML-RPC package, an email system, a session and caching package, a transaction management package, and more. The website's documentation includes both narrative and reference manuals, as well as tutorials that illustrate how to create applications using either of Pyramid's supported URL mapping techniques, and those for using either ZODB as the back-end database or the Python SQLAlchemy package.

Pyramid is by no means an easy system to master. It includes a great deal of convention and terminology, mainly revolving around the paste tools. You must follow the introductory tutorial closely to figure out where everything goes and why. Nevertheless, it boasts an impressive pedigree and an equally impressive array of add-ons, and the "policy free" approach makes it adaptable -- with effort, of course -- to vastly different Web application architectures.

Read reviews of other Python Web frameworks:

This article, "Pillars of Python: Pyramid Web framework," was originally published at InfoWorld.com. Follow the latest developments in application development and Python at InfoWorld.com. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Copyright © 2011 IDG Communications, Inc.

1 2 3 Page 3
Page 3 of 3
InfoWorld Technology of the Year Awards 2023. Now open for entries!