CherryPy

Last updated
CherryPy
Developer(s) CherryPy team
Initial releaseJune 2002;21 years ago (2002-06) [1]
Stable release
18.8.0 [2]   OOjs UI icon edit-ltr-progressive.svg / 18 July 2022;20 months ago (18 July 2022)
Repository CherryPy Repository
Written in Python
Operating system Cross-platform
Type Web application framework
License BSD License [3]
Website cherrypy.dev

CherryPy is an object-oriented web application framework using the Python programming language. It is designed for rapid development of web applications by wrapping the HTTP protocol but stays at a low level and does not offer much more than what is defined in RFC 7231.

Contents

CherryPy can be a web server itself or one can launch it via any WSGI compatible environment. It does not deal with tasks such as templating for output rendering or backend access. The framework is extensible with filters, which are called at defined points in the request/response processing.

Pythonic interface

One of the goals of the project founder, Remi Delon, was to make CherryPy as pythonic as possible. This allows the developer to use the framework as any regular Python module and to forget (from a technical point of view) that the application is for the web.

For instance, the common Hello World program with CherryPy 3 would look like:

importcherrypyclassHelloWorld:defindex(self):return"Hello World!"index.exposed=Truecherrypy.quickstart(HelloWorld())

Features

CherryPy implements:

CherryPy doesn't force you to use a specific object-relational mapper (ORM), template language or JavaScript library.

Can be used with CherryPy

Object-relational mappers

Templating languages

  • Mako [19] — a template library written in Python, usable with a simple CherryPy tool. [20]
  • Cheetah — an open source template engine and code generation tool, written in Python.
  • CherryTemplate — a templating language for CherryPy.
  • Genshi [21] [22] — a powerful XML templating language.
  • Jinja — a general purpose templating language. CherryPy has a tool for using Jinja templates. [23]
  • Kid — a simple template language for XML based vocabularies written in Python. TurboGears 1.x uses CherryPy as server and Kid as frontend. [24]

CherryPy wiki helps [25] choosing a templating language.

Products using CherryPy

See also

Related Research Articles

The Web Server Gateway Interface 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, version 1.0.1, is specified in Python Enhancement Proposal (PEP) 3333.

In computing, a solution stack or software stack is a set of software subsystems or components needed to create a complete platform such that no additional software is needed to support applications. Applications are said to "run on" or "run on top of" the resulting platform.

<span class="mw-page-title-main">Django (web framework)</span> Python web framework

Django is a free and open-source, Python-based web framework that runs on a web server. It follows the model–template–views (MTV) architectural pattern. It is maintained by the Django Software Foundation (DSF), an independent organization established in the US as a 501(c)(3) non-profit.

<span class="mw-page-title-main">TurboGears</span>

TurboGears is a Python web application framework consisting of several WSGI components such as WebOb, SQLAlchemy, Kajiki template language and Repoze.

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. It is very similar to Ruby on Rails' ActiveRecord in operation in that it uses class definitions to form table schemas, and utilizes the language's reflection and dynamism to be useful.

Nevow is a Python web application framework originally developed by the company Divmod. Template substitution is achieved via a small Tag Attribute Language, which is usually embedded in on-disk XML templates, though there is also a pure-Python domain-specific language called Stan, for expressing this markup programmatically. Nevow integrates well with Twisted, a framework for event-driven programming.

Genshi is a template engine for XML-based vocabularies written in Python. Genshi is used to easily insert generated output into XML-based languages, usually HTML, and reuse elements between documents. Genshi's syntax is based on Kid, but its architecture is different. Genshi aims to implement some of its functionality while processing templates faster, by dynamically processing templates using a stream based API, instead of compiling templates to Python code.

<span class="mw-page-title-main">SQLAlchemy</span>

SQLAlchemy is an open-source SQL toolkit and object-relational mapper (ORM) for the Python programming language released under the MIT License.

Python Paste, often simply called paste, is a set of utilities for web development in Python. Paste has been described as "a framework for web frameworks".

Google App Engine is a cloud computing platform as a service for developing and hosting web applications in Google-managed data centers. Applications are sandboxed and run across multiple servers. App Engine offers automatic scaling for web applications—as the number of requests increases for an application, App Engine automatically allocates more resources for the web application to handle the additional demand.

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 as developing web forms from scratch, although a web developer may build a form from scratch if required.

Storm is a Python programming library for object-relational mapping between one or more SQL databases and Python objects. It allows Python developers to formulate complex queries spanning multiple database tables to support dynamic storage and retrieval of object information.

<span class="mw-page-title-main">Flask (web framework)</span> Python 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 third-party libraries provide common functions. However, Flask supports extensions that can add application features as if they were implemented in Flask itself. Extensions exist for object-relational mappers, form validation, upload handling, various open authentication technologies and several common framework related tools.

Pylons Project is an open-source 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.

Cubes is a light-weight open source multidimensional modelling and OLAP toolkit for development reporting applications and browsing of aggregated data written in Python programming language released under the MIT License.

Jam.py is free and open-source low-code/no-code "full stack" WSGI rapid application development framework for the JavaScript and Python programming language.

<span class="mw-page-title-main">Mako (template engine)</span> Python template library

Mako is a template library written in Python. Mako is an embedded Python language, which refines the familiar ideas of componentized layout and inheritance. The Mako template is used by Reddit. It is the default template language included with the Pylons and Pyramid web frameworks.

References

  1. "History of CherryPy".
  2. "Release v18.8.0". 18 July 2022. Retrieved 18 July 2022.
  3. "cherrypy / CherryPy / source / cherrypy / LICENSE.txt". BitBucket. Archived from the original on 15 July 2017. Retrieved 21 February 2015.
  4. "CherryPy — A Minimalist Python Web Framework".
  5. "CherryPy v3 WSGI server benchmark results". Archived from the original on 2016-03-03. Retrieved 2009-09-23.
  6. How fast is CherryPy? Archived 10 February 2010 at the Wayback Machine
  7. "How to set up multiple HTTP servers with CherryPy". Archived from the original on 2016-03-03. Retrieved 2009-09-23.
  8. Custom engine plugins with CherryPy Archived 3 May 2009 at the Wayback Machine
  9. Configuration system of CherryPy Archived 26 June 2009 at the Wayback Machine
  10. Configuration API of CherryPy Archived 1 July 2009 at the Wayback Machine
  11. Short summary of configuration options
  12. How to test CherryPy itself Archived 27 September 2009 at the Wayback Machine
  13. Profiler module of CherryPy Archived 9 February 2010 at the Wayback Machine
  14. "How to collect and the analyse coverage data of application code with CherryPy". Archived from the original on 2015-11-17. Retrieved 2009-09-23.
  15. "A simple dispatcher tool for CherryPy that uses Routes". Archived from the original on 2016-01-14. Retrieved 2009-09-27.
  16. TurboGears 2.x uses CherryPy as server and SQLAlchemy as its default ORM
  17. TurboGears 1.x uses CherryPy as server and SQLObject as ORM Archived 22 September 2009 at the Wayback Machine
  18. Dejavu Archived 17 May 2009 at the Wayback Machine
  19. Mako
  20. "A simple CherryPy tool for Mako templating". Archived from the original on 2016-03-03. Retrieved 2009-09-21.
  21. "CherryPy – Genshi" . Retrieved 2009-09-26.
  22. "Genshi - CherryPy Tools - Trac". Archived from the original on 2012-02-27. Retrieved 2009-09-26.
  23. "A basic CherryPy Tool for using Jinja templates". Archived from the original on 2015-09-05. Retrieved 2009-09-23.
  24. TurboGears 1.x uses CherryPy as server and Kid as frontend Archived 22 September 2009 at the Wayback Machine
  25. CherryPy wiki about choosing a templating language Archived 10 February 2010 at the Wayback Machine
  26. "CherryPy - Splunk Knowledgebase". Archived from the original on 2015-11-17. Retrieved 2015-03-24.