Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A project to produce swagger from pecan

Project Description

some helpers to create swagger output from a pecan app

example usage

given a file named

import pecan
from pecan_swagger import decorators as swagger

@swagger.path('profile', 'Profile', 'Root')
class ProfileController(object):

    @pecan.expose(generic=True, template='index.html')
    def index(self):
        return dict()

    def index_post(self, **kw):

@swagger.path('/', 'Root')
class RootController(object):

    profile = ProfileController()

and another file named

import pprint

from pecan_swagger import utils
import myapp

pp = pprint.PrettyPrinter(indent=2)
pp.pprint(utils.swagger_build('myapp', '1.0'))

the following will be produced when run

$ python
  "swagger": "2.0",
  "info": {
    "version": "1.0",
    "title": "myapp"
  "paths": {
    "/profile": {
      "POST": {},
      "GET": {}

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(6.7 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Jun 2, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers