Extending Pyramid

Pyramid may be extended through add-ons and development environments. The Python Package Index trove classifier "Framework :: Pyramid" is used by over 350 packages. Support may be "official" by the Pylons Project or "unofficial" by the community.

All projects under the Pylons Project have 100% test coverage and 100% documentation.

An "add-on" is a package which relies on Pyramid itself and extends the functionality of Pyramid, such as adding an ORM, sending email, or using a template-based language. If your add-on does not rely on Pyramid, it's not an add-on, but just a library, and it will not be listed on the Extending Pyramid page.

"Development environments" are a special category of packages which use Pyramid as a core, but offer alternative services and scaffolding to ease web application development. Some could be labeled "content management system" or "admin interface". Development environments often have dependencies beyond those of the Pyramid core.

Contributing add-ons

Add-ons may be created and shared wherever you like. Pylons Project supported add-ons must be under its GitHub organization account, and comply with guidelines for How to Contribute Source Code and Documentation, Coding Style and Standards, and Unit Testing Guidelines. All Pylons Project participants should strive to follow our Code of Conduct.

To add your project to the listing, create a new issue using the template as a guide.

plaster

A configuration loader interface around multiple file formats.
Maintainers: Michael Merickel
PyPI VCS docs

pyramid_ldap

An LDAP authentication policy for Pyramid.
Maintainers: Chris McDonough
PyPI VCS docs

pyramid_who

Authentication policy for Pyramid using repoze.who 2.0 API.
Maintainers: Chris McDonough, Tres Seaver
PyPI VCS docs

pyramid_zcml

Zope Configuration Markup Language configuration support for Pyramid.
Maintainers: Chris McDonough
PyPI VCS docs

pyramid_debugtoolbar

An interactive HTML debug toolbar for Pyramid.
Maintainers: Chris McDonough, Blaise Laflamme, Michael Merickel
PyPI VCS docs

pyramid_exclog

A package which logs exceptions from Pyramid applications.
Maintainers: Chris McDonough
PyPI VCS docs

Substance-D

An application server built upon the Pyramid web framework. It provides a user interface for managing content as well as libraries and utilities which make it easy to create applications.
Maintainers: chrism, cguardia
PyPI VCS docs

pyramid_mailer

A package for the Pyramid framework to take the pain out of sending emails.
Maintainers: Dan Jacobs, Chris McDonough
PyPI VCS docs

hupper

A process monitor / reloader for developers that can watch files for changes and restart the process.
Maintainers: mmerickel
PyPI VCS docs

pyramid_retry

An execution policy for Pyramid that supports retrying requests after certain failure exceptions.
Maintainers: Michael Merickel
PyPI VCS docs

pyramid-cookiecutter-alchemy

A cookiecutter (project template) for creating a Pyramid project using SQLite as persistent storage, SQLAlchemy as an ORM, URL dispatch for routing, and Jinja2 for templating.
Maintainers: cguardia
VCS

pyramid-cookiecutter-starter

A cookiecutter (project template) for creating a Pyramid starter project using Chameleon for templating.
Maintainers: cguardia
VCS

pyramid-cookiecutter-zodb

A cookiecutter (project template) for creating a Pyramid project using ZODB for persistent storage, traversal for routing, and Chameleon for templating.
Maintainers: cguardia
VCS

substanced-cookiecutter

A cookiecutter (project template) for creating a Substance D starter project.
Maintainers: cguardia
VCS

pyramid_rpc

RPC service add-on for Pyramid. Supports XML-RPC in a more extensible manner than pyramid_xmlrpc with support for JSON-RPC and AMF.
Maintainers: Michael Merickel, Ben Bangert
PyPI VCS docs

pyramid_nacl_session

Defines an encrypting, pickle-based cookie serializer, using PyNaCl to generate the symmetric encryption for the cookie state.
Maintainers: Tres Seaver
PyPI VCS docs

pyramid_tm

Centralized transaction management for Pyramid applications (without middleware).
Maintainers: Chris McDonough
PyPI VCS docs

pyramid_zodbconn

ZODB Database connection management for Pyramid.
Maintainers: Chris McDonough, Chris Rossi
PyPI VCS docs

pyramid_chameleon

Chameleon templating bindings for Pyramid
Maintainers: Chris McDonough
PyPI VCS docs

pyramid_jinja2

Jinja2 template renderer for Pyramid
Maintainers: Domen Kožar
PyPI VCS docs

pyramid_mako

Mako templating bindings for Pyramid.
Maintainers: Bert JW Regeer
PyPI VCS docs

pyramid_layout

Pyramid add-on for managing UI layouts.
Maintainers: Chris Rossi, Paul Everitt, Blaise Laflamme
PyPI VCS docs

waitress

Waitress is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones which live in the Python standard library.
Maintainers: chrism, xistence
PyPI VCS docs

velruse

Simplifying third-party authentication for web applications. It supports most auth providers.
Maintainers: bbangert, mmerickel
PyPI VCS docs

pyramid_handlers

Analogue of Pylons-style "controllers" for Pyramid. Note: Outgrowing Pyramid Handlers
Maintainers: Ben Bangert, Chris McDonough
PyPI VCS docs

pyramid_jqm

Scaffolding for developing jQuery Mobile apps with Pyramid.
Maintainers: Chris McDonough
PyPI VCS docs

pyramid_xmlrpc

XML-RPC add-on for Pyramid
Maintainers: Chris McDonough
PyPI VCS docs

pyramid_beaker

Beaker session backend plug-in.
Maintainers: Ben Bangert, Chris McDonough
PyPI VCS docs

pyramid_extdirect

Plugin that provides a router for the ExtDirect Sencha API included in ExtJS.
Maintainers: jenner
PyPI VCS

pyramid_swagger

This project offers convenient tools for using Swagger to define and validate your interfaces in a Pyramid webapp.
Maintainers: Scott Triglia
PyPI VCS docs

pyramid_bowerstatic

Integration of Bowerstatic in Pyramid
Maintainers: mrijken
PyPI VCS

pyramid_webassets

Pyramid extension for working with the webassets library.
Maintainers: tilgovi, sontek
PyPI VCS

Stargate

Stargate is a package for adding WebSockets support to Pyramid applications using the excellent eventlet library for long running connections.
Maintainers: boothead
PyPI VCS docs

aiopyramid

Run pyramid using asyncio.
Maintainers: housleyjk
PyPI VCS docs

gevent-socketio

gevent-socketio is a Python implementation of the Socket.IO protocol, developed originally for Node.js by LearnBoost and then ported to other languages.
Maintainers: @bourgetalexndre and seeking new maintainers
PyPI VCS docs

Authomatic

Simple yet powerful authorization and authentication client library for Python web applications.
Maintainers: peterhudec
PyPI VCS docs

Python Social Auth

Social authentication/registration mechanism with support for a large number of providers.
Maintainers: omab
PyPI VCS docs

pyramid_authsanity

Provides a secure authentication policy with an easy to use backend.
Maintainers: Bert JW Regeer
PyPI VCS docs

pyramid_jwt

Implementation of an authentication policy for Pyramid that uses JSON Web Tokens. This standard (RFC 7519) is often used to secure backend APIs. The excellent PyJWT library is used for the JWT encoding / decoding logic.
Maintainers: wichert
PyPI VCS docs

pyramid_persona

Provides persona authentication. Note: On November 30th, 2016, Mozilla will shut down the persona.org services. Persona.org and related domains will be taken offline.
Maintainers: madjar
PyPI VCS docs

pyramid_simpleauth

Session-based authentication and role based security.
Maintainers: thruflo, andrecp
PyPI VCS docs

pyramid_yosai

Yosai is a security framework that offers two-factor authentication, permission and role based authorization, and session management from a developer-friendly API. pyramid_yosai integrates yosai with pyramid web applications.
Maintainers: Darin Gordon
PyPI VCS docs

horus

User registration and login system for the Pyramid Web Framework.
Maintainers: sontek
PyPI VCS

pyramid_authstack

Use multiple authentication policies with Pyramid.
Maintainers: wichert
PyPI VCS

pyramid_multiauth

An authentication policy for Pyramid that proxies to a stack of other authentication policies.
Maintainers: leplatrem, natim, rafrombrc, alexis.metaireau, tarek, rfk
PyPI VCS

pyramid_dogpile_cache

dogpile.cache configuration package for Pyramid.
Maintainers: moriyoshi
PyPI VCS docs

pyramid_nacl_session

Defines an encrypting, pickle-based cookie serializer, using PyNaCl to generate the symmetric encryption for the cookie state.
Maintainers: tseaver
PyPI VCS docs

pyramid_redis_sessions

Session factory backed by Redis.
Maintainers: erasmas
PyPI VCS docs

pyramid_services

Defines a pattern and helper methods for accessing a pluggable service layer from within your Pyramid apps.
Maintainers: mmerickel
PyPI VCS docs

pyramid-opentracing

OpenTracing library/tween for tracing/integration of Pyramid's requests.
Maintainers: Carlos Alberto Cortez
PyPI VCS docs

pyramid_bpython

bpython bindings for Pyramid's pshell
Maintainers: mmerickel
PyPI VCS docs

pyramid_debugtoolbar_dogpile

dogpile caching support for pyramid_debugtoolbar
Maintainers: jvanasco
PyPI VCS

pyramid_ipython

IPython bindings for Pyramid's pshell
Maintainers: mmerickel
PyPI VCS docs

pyramid_pycallgraph

This package provides a Pyramid tween to generate a callgraph image for every request.
Maintainers: disko
PyPI VCS

pyramid-log

A logging formatter which makes Pyramid request attributes available for us in its format string.
Maintainers: Jeff Dairiki
PyPI VCS

Akhet

A Pyramid library and demo application with a Pylons-like feel. Its most known for its former application scaffold, which helped users transition from Pylons and those preferring a more Pylons-like API. The scaffold has been retired but the demo plays a similar role.
Maintainers: Mike Orr
PyPI VCS docs

Cliquet

Cliquet is a toolkit to ease the implementation of HTTP microservices, such as data-driven REST APIs.
Maintainers: Mozilla Services, n1k0, tarek, alexis.metaireau, leplatrem, Natim
PyPI VCS docs

Cornice

Provides helpers to build and document REST-ish web services with Pyramid, with decent default behaviors. It takes care of following the HTTP specification in an automated way where possible.
Maintainers: Mozilla Services, n1k0, leplatrem, natim, tarek, alexis.metaireau, rafrombrc, rfk
PyPI VCS docs

Khufu Project

Khufu is an application scaffolding for Pyramid that provides an environment to work with Jinja2 and SQLAlchemy.
Maintainers: Rocky Burt
VCS docs

Kotti

Kotti is a high-level, Pythonic web application framework. It includes an extensible Content Management System called the Kotti CMS, offering all the features you would expect from a modern CMS.
Maintainers: witsch, j23d, disko, nouri
PyPI VCS docs

Nive CMS

Nive is a new, "out of the box", open source content management system based on the programming language Python and the Pyramid web framework.
Maintainers: adroullier
VCS docs

Ptah

Ptah is a fast, fun, open source, high-level Python web development environment.
Maintainers: fafhrd, runyaga
PyPI VCS docs

Ringo

Ringo is a Python based high level web application framework build on top of Pyramid. The framework can be used to build form based management or administration software.
Maintainers: ti
PyPI VCS docs

Websauna

Websauna is a full stack application framework aimed for creating consumer and business web services built on top of Pyramid and SQLAlchemy.
Maintainers: miohtama
VCS docs

cone.app

A comprehensive web application stub on top of Pyramid
Maintainers: rnixx
PyPI VCS docs

nefertari

Nefertari is a REST API framework for Pyramid that uses ElasticSearch for reads and either MongoDB or Postgres for writes. It provides an interface to ElasticSearch's Query String DSL for full text search.
Maintainers: Jonathan.Stoikovitch, chrstphrhrt
PyPI VCS docs

pyramid_formalchemy

Auto-generated, customizable HTML input form fields from your SQLAlchemy mapped classes.
Maintainers: Gael Pasgrimaud
PyPI VCS docs

pyramid_royal

Royal is a Pyramid extension which eases writing RESTful web applications.
Maintainers: ludia, Merwok, hadrien
PyPI VCS docs

pyramid_sacrud

Pyramid CRUD interface. Provides an administration web interface for Pyramid.
Extensions:
* ps_alchemy - provides SQLAlchemy models.
* ps_tree - displays a list of records as tree. This works fine with models from sqlalchemy_mptt.
Maintainers: uralbash
PyPI VCS docs

pyramid_swagger

Convenient tools for using Swagger to define and validate your interfaces in a Pyramid webapp.
Maintainers: striglia
PyPI VCS docs

ramses

Ramses is a framework that generates a RESTful API using RAML. It uses Pyramid and Nefertari, which provides Elasticsearch / Posgres / MongoDB / Your Data Store™ -powered views.
Maintainers: Jonathan.Stoikovitch, chrstphrhrt
PyPI VCS docs

rest_toolkit

rest_toolkit is a Python package which provides a very convenient way to build REST servers. It is build on top of Pyramid, but you do not need to know much about Pyramid to use rest_toolkit.
Maintainers: wichert
PyPI VCS docs

pyramid_autodoc

Sphinx extension for documenting your Pyramid APIs.
Maintainers: sciyoshi, kaboomfox, sontek
PyPI VCS docs

pyramid_mailgun

This package integrates the Mailgun service with the Pyramid web framework.
Maintainers: evannook
PyPI VCS

pyramid_marrowmailer

Pyramid integration package for marrow.mailer, formerly known as TurboMail
Maintainers: iElectric
PyPI VCS docs

ColanderAlchemy

Auto-generate Colander schemas that are based on SQLAlchemy mapped classes.
Maintainers: tisdall, stefanofontanelli
PyPI VCS docs

WTForms

A flexible forms validation and rendering library for Python web development.
Maintainers: prencher, crast
PyPI VCS docs

colander

A serialization/deserialization/validation library for strings, mappings, and lists.
Maintainers: tseaver, chrism, mmerickel
PyPI VCS docs

deform

A Python HTML form generation library.
Maintainers: chrism, miohtama
PyPI VCS docs

marshmallow

A lightweight library for converting complex objects to and from simple Python data types (i.e., (de)serialization and validation).
Maintainers: sloria
PyPI VCS docs

lingua

Lingua is a package with tools to extract translatable texts from your code, and to check existing translations. It replaces the use of the xgettext command from gettext, or pybabel from Babel.
Maintainers: wichert
PyPI VCS docs

pyramid_elfinder

Connector for elfinder file manager
Maintainers: uralbash
VCS docs

pyramid_tablib

tablib renderer factory (xlsx, xls, csv) for Pyramid.
Maintainers: lxneng
PyPI VCS

webargs

A friendly library for parsing HTTP request arguments, with built-in support for popular web frameworks.
Maintainers: sloria
PyPI VCS docs

tomb_routes

A set of sane routing defaults for the Pyramid web framework.
Maintainers: msabramo, sontek
PyPI VCS

Pyramid Runner

A minimal Pyramid scaffold that aims to provide a starter template to build small to large web services.
Maintainers: Asif Mahmud Shimon
VCS

apex

Toolkit for Pyramid to add Authentication and Authorization using Velruse (OAuth) or a local database, CSRF, ReCaptcha, Sessions, Flash messages, and I18N.
Maintainers: cd34
PyPI VCS docs

pyramid_mongodb

Basic Pyramid scaffold to easily use MongoDB for persistence with the Pyramid Web framework.
Maintainers: Niall O'Higgins
PyPI VCS

ziggurat_foundations

Framework agnostic set of SQLAlchemy classes that make building applications that require permissions an easy task.
Maintainers: ergo
PyPI VCS docs

pyramid_sms

SMS services for Pyramid framework.
Maintainers: miohtama
PyPI VCS docs

Kinto

Kinto is a lightweight JSON storage service with synchronisation and sharing abilities.
Maintainers: Mozilla Services, n1k0, Natim, tarek, alexis.metaireau, leplatrem
PyPI VCS docs

pyramid_mongoengine

Pyramid-mongoengine package based on flask-mongoengine.
Maintainers: marioidival
PyPI VCS docs

pyramid_sqlalchemy

Provides some basic glue to facilitate using SQLAlchemy with Pyramid.
Maintainers: wichert
PyPI VCS docs

pyramid_storage

A simple file upload manager for the Pyramid framework. It currently supports uploads to the local file system and to the Amazon S3 cloud storage service.
Maintainers: danjac
PyPI VCS docs

zope.sqlalchemy

Integration of SQLAlchemy with transaction management. See also What the Zope Transaction Manager Means To Me (and you).
Maintainers: chrism, laurencerowe
PyPI VCS docs

pyramid_celery

Pyramid configuration with celery integration. Allows you to use Pyramid .ini files to configure celery and have your Pyramid configuration inside celery tasks.
Maintainers: sontek
PyPI VCS docs

pyramid_rq

Support using the RQ queueing system with Pyramid.
Maintainers: wichert
VCS

Tonnikala

Python templating engine with Pyramid integration.
Maintainers: hieu.nguyen, ztane
PyPI VCS docs

pyramid_skins

This package provides a simple framework to integrate code with templates and resources.
Maintainers: fschulze, malthe, witsch
PyPI VCS docs

webtest

Wraps any WSGI application and makes it easy to send test requests to that application, without starting up an HTTP server.
Maintainers: iElectric, gawel, ianb
PyPI VCS docs

SUMA

Microservice to manage external links.
Maintainers: rach
PyPI VCS

paginate

Python pagination module.
Maintainers: ergo, crooksey, signum
PyPI VCS docs

pyramid_pages

Provides a collection of web pages to your Pyramid application. This is very similar to django.contrib.flatpages but with a tree structure and traversal algorithm in URL dispatch.
Maintainers: uralbash
PyPI VCS docs

Making good add-ons

Add-on packages should be named pyramid_foo where foo describes the functionality of the package. For example, pyramid_mailer is a great name for something that provides outbound mail service. If the name you want has already been taken, try to think of another, for example, pyramid_mailout. If the functionality of the package cannot easily be described with one word, or the name you want has already been taken and you can't think of another name related to functionality, use a codename, for example, pyramid_postoffice.

If your package provides "configuration" functionality, you will be tempted to create your own framework to do the configuration, like the following:

              class MyConfigurationExtender(object):
    def __init__(self, config):
        self.config = config

    def doit(self, a, b):
        self.config.somedirective(a, b)

extender = MyConfigurationExtender(config)
extender.doit(1, 2)
            

Instead of doing so, use the add_directive method of a configurator as documented at Adding Methods to the Configurator via add_directive:

              def doit(config, a, b):
    config.somedirective(a, b)

config.add_directive('doit', doit)
            

If your add-on wants to provide some default behavior, provide an includeme method in your add-on's __init__.py, so config.include('pyramid_foo') will pick it up. See Including Configuration From External Sources.

Making Good Development Environments

If you are creating a higher-level framework atop the Pyramid codebase that contains "template" code (skeleton code rendered by a user via pcreate -t foo), for the purposes of uniformity with other "development environment" packages, we offer some guidelines below.

  • It should not be named with a pyramid_ prefix. For example, instead of pyramid_foo it should just be named foo. The pyramid_ prefix is best used for add-ons that plug some discrete functionality in to Pyramid, not for code that simply uses Pyramid as a base for a separate framework with its own "opinions".
  • It should be possible to subsequently run pserve development.ini to start any pcreate-rendered application.
  • development.ini should ensure that the pyramid_debugtoolbar package is active.
  • There should be a production.ini file that mirrors development.ini but disincludes pyramid_debugtoolbar.
  • The [server:main] section of both production.ini and development.ini should start paste.httpserver on port 6543:

                  [server:main]
    use = egg:Paste#http
    host = 0.0.0.0
    port = 6543
                

  • development.ini and production.ini should configure logging (see any existing template).
  • It should be possible to use pshell development.ini to visit an interactive shell using a pcreate-rendered application.
  • Startup/configuration code should live in a function named main within the __init__.py of the main package of the rendered template. This function should be linked within a paster.app_factory section in the template's setup.py like so:

                  entry_points = """\
    [paste.app_factory]
    main = {{package}}:main
    """
                

  • This makes it possible for users to use the following pattern (particularly use = egg:{{project}}):

                  [app:{{project}}]
    use = egg:{{project}}
    reload_templates = true
    .. other config ..
                

  • WSGI middleware configuration should not be inlined into imperative code within the main function. Instead, middleware should be configured within a [pipeline:main] section in the configuration file:

                  [pipeline:main]
    pipeline =
        egg:WebError#evalerror
        tm
        {{project}}