Pyramid (web framework)
   HOME

TheInfoList



OR:

Pylons Project is an open-source organization that develops a set of web application technologies written in
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
. 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
web framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and ...
written in
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
and is based on WSGI. It is a minimalistic web framework inspired by
Zope Zope is a family of free and open-source web application servers written in Python, and their associated online community. Zope stands for "Z Object Publishing Environment", and was the first system using the now common object publishing methodol ...
,
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 Zope is a family of free and open-source web application servers written in Python, and their associated online community. Zope stands for "Z Object Publishing Environment", and was the first system using the now common object publishing methodol ...
and
Plone Plone is a free and open source content management system (CMS) built on top of the Zope application server. Plone is positioned as an enterprise CMS and is commonly used for intranets and as part of the web presence of large organizations. Hi ...
community as the
Open Society Institute Open Society Foundations (OSF), formerly the Open Society Institute, is a grantmaking network founded and chaired by business magnate George Soros. Open Society Foundations financially supports civil society groups around the world, with a st ...
'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 The Zope Object Database (ZODB) is an object-oriented database for transparently and persistently storing Python objects. It is included as part of the Zope web application server, but can also be used independently of Zope. Features of the ZOD ...
, as well as other NoSQL databases, such as
CouchDB Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang. CouchDB uses multiple formats and protocols to store, transfer, and process its data. It uses JSON to store data, JavaScript as its query language using ...
. Pyramid allows developers to define routes using
regular expressions A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" o ...
that map to objects. Like its fellow framework Zope, Pyramid also allows hierarchical object traversal, where each part of a URL 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
Web application framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build an ...
written in
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
. It makes extensive use of the Web Server Gateway Interface standard to promote reusability and to separate functionality into distinct modules.The
mod_wsgi mod_wsgi is an Apache HTTP Server module by Graham Dumpleton that provides a WSGI compliant interface for hosting Python based web applications under Apache. As of version 4.5.3, mod_wsgi supports Python 2 and 3 (starting from 2.6 and 3.2). It ...
br>project
includes both Pylons and Pyramid in its list of supported major Python web frameworks.
It is strongly influenced by
Ruby on Rails Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and we ...
: 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 setuptools is a package development process library designed to facilitate packaging Python projects by enhancing the Python standard library (distribution utilities). It includes: *Python package and module definitions *Distribution package m ...
via the
Python Package Index The Python Package Index, abbreviated as PyPI () and also known as the Cheese Shop (a reference to the ''Monty Python's Flying Circus'' sketch " Cheese Shop"), is the official third-party software repository for Python. It is analogous to the C ...
(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 JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
code making use of the script.aculo.us and Prototype libraries. FormEncode and FormBuild are used for HTML form validation and generation; there has been some use of
Mako , better known by the mononym name Mako (sometimes stylised MAKO), is a Japanese voice actress, singer and a member of the band Bon-Bon Blanco, in which her prominent role is as the maraca player. She has also performed in a Japanese television ...
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 , better known by the mononym name Mako (sometimes stylised MAKO), is a Japanese voice actress, singer and a member of the band Bon-Bon Blanco, in which her prominent role is as the maraca player. She has also performed in a Japanese television ...
. Both templating languages are text-based (as opposed to
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
-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.htmlNotes 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) Django ( ; sometimes stylized as django) is a free and open-source, Python-based web framework that follows the model–template–views (MTV) architectural pattern. It is maintained by the Django Software Foundation (DSF), an independent o ...
*
FastAPI FastAPI is a Web framework for developing RESTful APIs in Python. FastAPI is based on Pydantic and type hints to validate, serialize, and deserialize data, and automatically auto-generate OpenAPI documents. It fully supports asynchronous ...
*
Flask (web framework) Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing t ...
*
Web2py Web2py is an open-source web application framework written in the Python programming language. Web2py allows web developers to program dynamic web content using Python. Web2py is designed to help reduce tedious web development tasks, such a ...
*
TurboGears TurboGears is a Python web application framework consisting of several WSGI components such as WebOb, SQLAlchemyKajikitemplate language and Repoze. TurboGears is designed around the model–view–controller (MVC) architecture, much like Stru ...
: a derivative project, built on top of Pylons *
Tornado A tornado is a violently rotating column of air that is in contact with both the surface of the Earth and a cumulonimbus cloud or, in rare cases, the base of a cumulus cloud. It is often referred to as a twister, whirlwind or cyclone, altho ...
* Comparison of web frameworks


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 (программный каркас)