cherrypy-cors
CORS handling as a cherrypy tool.
What it is and what it does
cherrypy-cors is a CherryPy tool that handles Cross-Origin Resource Sharing (CORS) headers for web applications. It lets you enable CORS either globally across your entire application or selectively for specific routes and resources, managing the HTTP headers that browsers use to determine whether cross-origin requests are allowed.
The package integrates directly into CherryPy's configuration system, so you enable it by adding tool settings to your route or application config rather than writing custom middleware. It has been stable since its initial release and requires only CherryPy and httpagentparser as runtime dependencies, making it lightweight to add to existing CherryPy projects.
Use it for:
- Enable a CherryPy-based API to accept requests from web frontends hosted on different domains.
- Selectively expose static resources (CSS, JavaScript, images) to cross-origin requests while protecting other endpoints.
- Configure CORS headers for specific application routes without modifying core request handling logic.
- Allow browser-based clients to make XMLHttpRequest or Fetch API calls to your CherryPy backend.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds Cross-Origin Resource Sharing (CORS) support to CherryPy applications via a configurable tool that can be installed globally or per-application.
Yes. This is a lightweight, actively maintained tool for a common need in web development. If you're building a CherryPy application that needs to serve cross-origin requests, it's the natural choice. The permissive MIT license and low dependency count make it safe to add. No known vulnerabilities.
Install
cherrypy-cors on PyPI
pip
pip install cherrypy-corsuv
uv add cherrypy-corspoetry
poetry add cherrypy-corsInstalling cherrypy-cors
Before you install
Low friction installation with only two runtime dependencies (cherrypy and httpagentparser). The package is actively maintained with a recent release in August 2023 and an active repository.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.
Quickstart
import cherrypy_cors
cherrypy_cors.install()
# Or add to specific app:
app = cherrypy.tree.mount(...)
app.toolboxes['cors'] = cherrypy_cors.tools
# Enable in config:
config = {'tools.cors.expose.on': True}
Requires CherryPy to be installed and configured; Python 3.8 or later.
Verify before relying
- Whether the package supports all modern CORS scenarios (preflight requests, credential handling, custom headers).
- Performance characteristics when handling high request volumes.
- Compatibility with recent CherryPy versions beyond what the fact sheet indicates.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — cherrypy, httpagentparser |
| Maintenance | actively maintained — 1,082 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 131,017/month — #11,613 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cherrypy_cors-1.7.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
django-cors-headersAdds Cross-Origin Resource Sharing (CORS)…
permissive · top 1,000 on PyPI
flask-corsFlask-CORS handles Cross-Origin Resource…
permissive · top 1,000 on PyPI
aiohttp-corsAdds Cross-Origin Resource Sharing (CORS)…
permissive · top 5,000 on PyPI
Sanic-CorsSanic-CORS is a Sanic extension that adds…
permissive · top 15,000 on PyPI
quart-corsQuart-CORS adds Cross-Origin Resource Sharing…
permissive · top 15,000 on PyPI
invenio-restInvenio-REST provides Flask-based REST API…
permissive · top 15,000 on PyPI
fastapi-corsConfigures CORS settings for FastAPI…
permissive · top 15,000 on PyPI
aiohttp-middlewaresProvides a collection of ready-to-use…
permissive · top 15,000 on PyPI
CherryPyCherryPy is an object-oriented HTTP framework…
permissive · top 5,000 on PyPI