Registry / web-framework / pyramid

pyramid

JSON →
library2.1pypypi✓ verified 26d ago

Pyramid is a minimalistic, flexible, and open-source Python web framework that prioritizes simplicity, scalability, and ease of use. It is part of the Pylons Project and is currently at version 2.1, with releases typically following a maintenance and deprecation policy where deprecated features are kept for at least three minor releases before removal. [1, 2, 12, 16]

pip install "pyramid==2.1"
INSTALL
IMPORT
SIG · PYRAMID
P
pyramid
web-frameworkpythonv2.1
Install
2.7s avg
Import
652ms
Disk
27MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 2.45s
py 3.11
✓ —
✓ 2.55s
py 3.12
✓ —
✓ 2.9s
py 3.13
✓ —
✓ 3.05s
py 3.9
1/2 runs
1/2 runs
27MB installed
● package 27MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Configurator
from pyramid.config import Configurator
Response
from pyramid.response import Response
make_server
from wsgiref.simple_server import make_server
view_config
from pyramid.view import view_config
from pyramid.decorators import view_config
While older patterns might have used `pyramid.decorators`, `pyramid.view.view_config` is the standard and recommended import for view configuration decorators. [10]

This minimal 'hello world' application demonstrates the core components of a Pyramid web application: `Configurator` for application setup, `add_route` to define a URL pattern, `add_view` to link a view callable to a route, and `Response` to return content. It uses `wsgiref.simple_server` to serve the application directly. [2, 5, 12]

from wsgiref.simple_server import make_server from pyramid.config import Configurator from pyramid.response import Response def hello_world(request): return Response('Hello World!') if __name__ == '__main__': with Configurator() as config: config.add_route('hello', '/') config.add_view(hello_world, route_name='hello') app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) print('Serving on http://0.0.0.0:6543') server.serve_forever()
pserve --version
Debug
Known issues
breakingPyramid versions 2.0 and later are Python 3 only. Python 2.x is no longer supported. [3, 14]
fix
Ensure your project runs on Python 3.10 or newer, as required by Pyramid 2.1. [1, 14]
affects: >=2.0
breakingThe authentication and authorization policies from Pyramid 1.x have been merged into a single security policy in Pyramid 2.0. The `ISession` interface for sessions now only supports JSON-serializable data types for security reasons, which is a backward-incompatible change. [14, 15]
fix
Migrate to the new single security policy using `pyramid.config.Configurator.set_security_policy()` and update session data to be JSON-serializable. Refer to the 'Upgrading Authentication/Authorization' and 'Upgrading Session Serialization' sections in the Pyramid 2.0 documentation for detailed migration steps. [14]
affects: >=2.0
deprecatedSeveral ACL-related constants previously imported from `pyramid.security` are now deprecated. [15]
fix
Import equivalent ACL-related objects from the `pyramid.authorization` namespace instead. For example, `pyramid.security.Everyone` should now be `pyramid.authorization.Everyone`. [15]
affects: >=2.0
gotchaPyramid's configuration system, especially with `.ini` files and `pserve`, is powerful but can be a point of confusion for new users. Incorrect configuration paths or settings can lead to application startup issues. [10, 13]
fix
Always follow the official 'Quick Tutorial' and 'Application Configuration with .ini Files' documentation. Use cookiecutters for project generation to set up a correct initial structure. Pay close attention to environment variables vs. `.ini` file settings. [3, 6, 13]
affects: All
Upgrade
Version history
2.1latest on PyPI · released Mar 11, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
pyramid — pip install pyramid · libregistry