tablib renderer (xlsx, xls, csv) for pyramid
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
src/pyramid_tablib
.gitignore
CHANGES.rst
README.rst
bootstrap.py
buildout.cfg
setup.py
versions.cfg

README.rst

Introduction

This package which provides custom renderer factory(xlsx, xls, csv) for Pyramid.

Getting Started

Include pyramid_tablib either by setting your includes in your .ini, or by calling config.include('pyramid_tablib').

pyramid.includes =
    pyramid_tablib

Now in your view

@view_config(route_name='users+xlsx', renderer='xlsx')
def all_users(request):
    headers = ['Name', 'City', 'Email']
    data = [(user.name, user.city, user.email) for user in users]
    return {'data': data, 'headers': headers, 'title': 'Users'}