Skip to main content

This is http://djangosnippets.org/snippets/1151/ uploaded to pypi. Author is Tarken.

A subclass of HttpResponse which will transform a QuerySet, or sequence of sequences, into either an Excel spreadsheet or CSV file formatted for Excel, depending on the amount of data. All of this is done in-memory and on-the-fly, with no disk writes, thanks to the StringIO library.

Installation

pip install django-excel-response xlwt

Usage

from excel_response import ExcelResponse

def excelview(request):
    objs = SomeModel.objects.all()
    return ExcelResponse(objs)

or:

from excel_response import ExcelResponse

def excelview(request):
    data = [
        ['Column 1', 'Column 2'],
        [1,2]
        [23,67]
    ]
    return ExcelResponse(data, 'my_data')

Metadata

Release files for django-excel-response 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-excel-response 1.0
File Size Uploaded Provenance
django-excel-response-1.0.tar.gz 2.4 kB Without provenance Details

Release files / django-excel-response-1.0.tar.gz

Download URL django-excel-response-1.0.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b708184ee1c93ac1769e72c49bae5666b9ffce0892daa0b54c7cbec98e1c6014
BLAKE2b-256 checksum
How to use checksums
3b88ed54fd80c752df475fbb84402fbbcec9e0cdbcf5a4c3051e9809f5b18630
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-excel-response 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page