This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
Django TarView

A base view to tar and stream several files.


pip install django-tarview

Usage and examples

To create a tar download view:

* Extend BaseTarView
* implement `get_files`
* That's it

The `get_files` method must return a list (or iterator) of file-like objects.

Example with a ContentFile:

from tarview.views import BaseTarView

class JustTextFilesView(BaseTarView):
Generate a tar with 10 files 'fileX.txt' with a simple text,
using Djangos ContentFile
def get_files(self):
for i in range(0,10):
file_like = ContentFile(b("This is file %d." % i), name="file%d.txt" % i)
yield file_like

Or pull them from a database like this:

from tarview.views import BaseTarView

from reviews import Review

class CommentsArchiveView(BaseTarView):
"""Download at once all comments for a review."""

def get_files(self):
document_key = self.kwargs.get('document_key')
reviews = Review.objects \
.filter(document__document_key=document_key) \

return [review.comments.file for review in reviews if]

View configuration

By default, the downloaded file is named `download.tar` you can set a custom name
by setting the `tarfile_name` parameter.


class TarView(BaseTarView):
tarfile_name = 'something.tar'


Django TarView uses [tox, the testing automation tool](,
to run tests.

To launch tests:

pip install tox


Crafted with love by luckydonald.
Modification of [Thibault Jouannic]('s work.
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-tarview-1.0.0.tar.gz (4.3 kB) Copy SHA256 Checksum SHA256 Source Dec 2, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting