Pylons Project is an
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
organization that develops a set of web application technologies written in
Python. Initially the project was a single web framework called Pylons, but after the merger with the repoze.bfg framework under the new name Pyramid, the Pylons Project now consists of multiple related web application technologies.
Pyramid
Pyramid is an
open source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
web framework written in
Python and is based on
WSGI
The Web Server Gateway Interface (WSGI, pronounced ''whiskey'' or ) is a simple calling convention for web servers to forward requests to web applications or frameworks written in the Python programming language. The current version of WSGI, v ...
. It is a
minimalistic Minimalism is a movement in visual arts, music, and other media that began in post–World War II Western art.
Minimalism may also refer to:
*Minimalism (computing), a philosophy of programming and configuring computers
*Minimalism (philosophy), ...
web framework inspired by
Zope,
Pylons
Pylon may refer to:
Structures and boundaries
* Pylon (architecture), the gateway to the inner part of an Ancient Egyptian temple or Christian cathedral
* Pylon, a support tower structure for suspension bridges or highways
* Pylon, an orange mar ...
and
Django.
Originally called "repoze.bfg", Pyramid gathered attention mostly in the
Zope and
Plone community as the
Open Society Institute's KARL project migrated from Plone to BFG.
In 2010 it was announced that the Pylons framework will move over to using BFG as a base in version 1.5.
As a result of the inclusion of BFG into the Pylons project, BFG was renamed Pyramid.
Features
Pyramid is a minimalistic,
platform-independent
In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software ...
web framework. It is persistence agnostic and is integrated both with SQL databases via
SQLAlchemy
SQLAlchemy is an open-source SQL toolkit and object-relational mapper (ORM) for the Python programming language released under the MIT License.
Description
SQLAlchemy's philosophy is that relational databases behave less like object collectio ...
and with the
Zope Object Database, as well as other
NoSQL
A NoSQL (originally referring to "non- SQL" or "non-relational") database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Such databases have existed ...
databases, such as
CouchDB.
Pyramid allows developers to define routes using
regular expressions that map to objects. Like its fellow framework Zope, Pyramid also allows hierarchical object traversal, where each part of a
URL
A Uniform Resource Locator (URL), colloquially termed as a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifie ...
is an object containing other objects, in a way that is similar to folders in a filesystem.
Pylons Web Framework
Pylons Framework is an
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
Web application framework written in
Python. It makes extensive use of the Web Server Gateway Interface standard to promote reusability and to separate functionality into distinct modules.
[The mod_wsgibr>project]
includes both Pylons and Pyramid in its list of supported major Python web frameworks. It is strongly influenced by
Ruby on Rails: two of its main components, Routes and WebHelpers, are Python reimplementations of Rails features.
Structure
Pylons is well known for having a near-complete stack of third-party tools, eschewing the
"not-invented-here" phenomenon.
Installation, dependencies, and setup
The official installation method of Pylons is through
EasyInstall via the
Python Package Index (PyPI), and most of the additional tools are typically installed the same way. EasyInstall also handles package dependencies when relevant. Some distributions could also package Pylons and
Paste, but it is likely that any distribution's packages would lag the official distribution. Pylons may also be installed by hand by renaming its .egg file to .zip and extracting the contents.
Paste is used for project setup, testing, and deployment. Using the common
INI configuration format, Paste allows for multiple "profiles", so that developers can run development and deployment setups from the same codebase without revealing sensitive parts of Pylons, such as the interactive debugger, to production users.
URL dispatch
Currently the only widely used URL dispatcher for Pylons is Routes, a Python reimplementation of Ruby on Rails' URL dispatching, although any WSGI-compatible URL dispatcher can be used. While Routes is a separate library, it was developed for use in Pylons and its development remains closely in sync with Pylons.
HTML generation
Another piece of Rails adapted for Pylons is WebHelpers, which provides URL mapping based on the Routes configuration. WebHelpers also provides some utility functions for generating
JavaScript code making use of the
script.aculo.us
The Prototype JavaScript Framework is a JavaScript framework created by Sam Stephenson in February 2005 as part of Ajax support in Ruby on Rails. It is implemented as a single file of JavaScript code, usually named prototype.js. Prototype is dis ...
and
Prototype
A prototype is an early sample, model, or release of a product built to test a concept or process. It is a term used in a variety of contexts, including semantics, design, electronics, and Software prototyping, software programming. A prototyp ...
libraries.
FormEncode and FormBuild are used for HTML form validation and generation; there has been some use of
Mako for form generation using Mako's inheritance model.
Templating
Myghty was the default Pylons templating language, but as of version 0.9.6 it has been replaced by
Mako. Both templating languages are text-based (as opposed to
XML-based), and support includes, inheritance and embedding arbitrary Python code.
Because of Pylons' loosely coupled layers, other templating languages can be used as well.
Genshi, an XML-based templating language, can be used in lieu of either Mako or Myghty.
[Genshi Wik]
Pylons with Genshi
Retrieved July 5, 2007
Database abstraction and object-relational mapping
Pylons has no default database library. Both
SQLObject
SQLObject is a Python object-relational mapper between a SQL database and Python objects. It is experiencing community popularity, and forms a part of many applications (e.g., TurboGears). It is very similar to Ruby on Rails' ActiveRecord in oper ...
and SQLAlchemy are known to be used.
Merger with repoze.bfg and birth of Pyramid Web Framework
Pylons has developed into the Pylons Project, and the old code from Pylons 1.0 is now in maintenance-only mode. However, pursuant to the project's merger with repoze.bfg since November 2010, newer versions of Pylons are actually different from the original Pylons 1.0. Pylons developers initially planned to rewrite certain portions of the code, but they observed that the new code was approximating repoze.bfg, which led to the merger of Pylons and repoze.bfg.
[Pylons Project FAQ. URL: https://pylonsproject.org/about-pylons-project.html][Notes on the Pylons and repoze.bfg merger. URL: ] This led to repoze.bfg (a part of the Repoze Python-based web framework) to become rebranded and relaunched as the Pyramid web framework.
[About Pyramid. URL: https://trypyramid.com/]
See also
*
Django (web framework)
*
FastAPI
*
Flask (web framework)
*
Web2py
*
TurboGears: a derivative project, built on top of Pylons
*
Tornado
*
Comparison of web frameworks Two comparisons of web frameworks are available:
* Comparison of JavaScript-based web frameworks (front-end)
* Comparison of server-side web frameworks
This is a comparison of notable web frameworks, software used to build and deploy web applicat ...
References
Further reading
*
External links
*
{{Web frameworks
Cross-platform free software
Free software programmed in Python
Python (programming language) software
Python (programming language) web frameworks
fr:Pyramid (framework)
ru:Pyramid (программный каркас)