CherryPy
Object-Oriented HTTP framework
What it is and what it does
CherryPy is a web framework that treats HTTP endpoints as Python object methods. Instead of routing URLs to functions, you define classes with methods decorated with @cherrypy.expose, and CherryPy automatically maps the object hierarchy to web paths. This approach aligns web development with standard object-oriented Python patterns, making code more readable and maintainable as applications grow.
The framework has been in production use for many years and is designed to be both intuitive for simple applications and capable of handling complex systems. It includes a built-in WSGI-compliant server, supports multiple Python implementations (CPython, PyPy, Jython), and provides configuration flexibility. The seven runtime dependencies are lightweight utilities for server functionality, file locking, and metadata handling.
Use it for:
- Build a REST API by exposing Python class methods as HTTP endpoints without explicit routing configuration.
- Create a web application where URL structure naturally mirrors your Python object model.
- Develop a microservice or internal tool that needs a lightweight HTTP server without framework overhead.
- Prototype or build production web services that prioritize code clarity and Pythonic design patterns.
- Integrate HTTP capabilities into an existing Python application with minimal additional dependencies.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
CherryPy is an object-oriented HTTP framework that lets you build web applications and APIs by writing Python classes and methods, then expose them as web endpoints.
Yes. CherryPy is a mature, actively maintained framework with low installation friction, no security vulnerabilities, and a permissive license. It's well-suited if you prefer object-oriented design patterns in web development and want a lightweight alternative to larger frameworks. The 791-day gap since the last release suggests stability rather than abandonment, but verify that current Python versions align with your needs.
Install
cherrypy on PyPI
pip
pip install cherrypyuv
uv add cherrypypoetry
poetry add cherrypyInstalling CherryPy
Before you install
Installation is straightforward with low friction. The package is actively maintained (last commit 2026-08-10) and marked as Production/Stable. Seven runtime dependencies are all standard utilities, and the wheel distribution ensures fast setup.
License in practice
Licensed under BSD (permissive), which allows commercial and private use with minimal restrictions. No licensing concerns for adoption.
Quickstart
pip install cherrypy
import cherrypy
class HelloWorld(object):
@cherrypy.expose
def index(self):
return "Hello World!"
cherrypy.quickstart(HelloWorld())
Requires Python 3.6 or later; on Windows, pywin32 is a runtime dependency.
Verify before relying
- Whether the 791 days since last release (2024-06-14) indicates a stable mature project or one that may need updates for newer Python versions.
- Performance characteristics and scalability limits compared to other frameworks in production deployments.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — cheroot, portend, more-itertools, zc.lockfile, jaraco.collections, importlib-metadata, pywin32 |
| Maintenance | actively maintained — 791 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 897,074/month — #4,785 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: CherryPy-18.10.0-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
hughug is a Python framework for building REST…
permissive · top 15,000 on PyPI
appierAppier is a lightweight Python web framework…
permissive · top 5,000 on PyPI
cherrypy-corsAdds Cross-Origin Resource Sharing (CORS)…
permissive · top 15,000 on PyPI
ws4pyws4py implements the WebSocket protocol (RFC…
permissive · top 15,000 on PyPI
toolA compact modular framework for building WSGI…
copyleft · top 15,000 on PyPI
webargswebargs parses and validates HTTP request…
permissive · top 5,000 on PyPI
pecanPecan is a WSGI web framework that routes HTTP…
permissive · top 15,000 on PyPI
namekoNameko is a microservices framework for Python…
permissive · top 15,000 on PyPI