Skip to main content

Easily create XLSX documents with Django

Project description

This is a wrapper for openpyxl which makes creating XLSX documents with the purpose of exporting data less boring:

from xlsxdocument import XLSXDocument

def xlsx_export(request):
    some_data = Bla.objects.all()

    xlsx = XLSXDocument()
    return xlsx.to_response('bla.xlsx')

Adding in additional cells at the end is also possible:

xlsx = XLSXDocument()
        'Full URL',
        lambda instance: '' % (

You can also easily add the facility to export rows to Django’s administration interface:

from django.contrib import admin
from django.utils.translation import gettext_lazy as _

from xlsxdocument import export_selected

from app import models

class AttendanceAdmin(admin.ModelAdmin):
    list_filter = ('event',)
    actions = (export_selected,), AttendanceAdmin)

If you require additional columns with export_selected use this snippet instead:

from xlsxdocument import create_export_selected

class AttendanceAdmin(...):
    actions = [
                # ... see above

Project details

Download files

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

Files for xlsxdocument, version 1.3.9
Filename, size File type Python version Upload date Hashes
Filename, size xlsxdocument-1.3.9-py2.py3-none-any.whl (4.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size xlsxdocument-1.3.9.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page