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

A Django application to create automated email reports in .csv format. It
includes a management command that is intended to be invoked periocically from


To install::

pip install django-reporter

Then add ``reporter`` to your INSTALLED_APPS::


Also, make sure the email settings for your project are correct.

Creating Reports

Similar to Django's admin app, reports are created within ** files
inside your installed applications. Inside each ** should be at
least one report that subclasses the ``reporter.BaseReport`` class. After the
subclass is defined, use the ``reporter.register()`` function to register the
report. Your subclass should define at least two attributes and implement
a few methods, detailed below. Review the ** file for an
example of a simple report.

Required Attributes

A basic report should have a docstring (which is shown with the ``--list-all``
option on the management command), and needs at least two attributes,
``name``, and ``frequencies``.

For example, the sample report starts out with::

class AdminLogReport(reporter.BaseReport):
Send full admin log info for the day, broken down by user
name = 'admin_log'
frequencies = ['daily']


.. attribute::

The name of the report, used when invoking the ``report`` management command.


.. attribute:: BaseReport.frequencies

The frequencies that this report is available for.

Built-in Attributes

The base class automatically sets a number of attributes that are available
in the subclass.


.. attribute:: BaseReport.frequency

The requested frequency of the report. This can be used to determine the
correct date range to filter for in your report.


.. attribute::

The requested date for the report. Defaults to today if no date is provided.


.. attribute:: BaseReport.tomorrow

The requested date plus 1 day.


.. attribute:: BaseReport.one_week

The requested date minus 7 days.


.. attribute:: BaseReport.one_month

The requested date minus 32 days.


.. attribute:: BaseReport.args

A list of additional arguments passed on to the report from the management


These methods are required to be implemented in your subclass in order to
generate reports.


.. method:: BaseReport.get_default_recipients(self):

This method is called by the base class's ``send_results`` method. It
provides the default recipients for the email, which is used if the recipients
are not overridden by the ``--recipients`` option on the management command.
This should return a list of strings containing the email address of each


.. method:: BaseReport.get_email_subject(self):

This method is also called by the base class's ``send_results`` method. It
provides the subject line for the email that is sent. It should return a


This is the method that the base class calls to retrieve the data that should
be converted to csv and sent through email. This should return a list of
rows, each row consisting of a list of fields.

For example, in the sample ``admin_log`` report, a header row is defined at
the top of the ``get_data`` method::

data = [['Username', 'Time', 'Action', 'Content Type', 'ID', 'Name']]

Then, for each row of data, a list of data within those fields is appended::

data.append([log.user, time, actions[log.action_flag],, log.object_id, obj_name])


Once the report is defined in the ** file, it's ready to be
registered. The sample report registers its class at the bottom of the file::


Running Reports

To run reports, use the ``report`` management command.



Valid frequencies are "daily", "weekly", and "monthly". By default, the
reports are emailed to the report's default recipients. This can be
overridden through the ``--recipients`` option. Additional arguments after
the report name will be passed to the report.


``-V, --view``

Send the data to stdout instead of emailing or saving to a file.

``-f FILE, --filename=FILE``

Instead of emailing the results, save them to the provided filename.

``-r RECIPIENTS, --recipients=RECIPIENTS``

Override the default recipients for the report. Seperate each email address
with a comma. Do not use spaces.

``-l, --list-all``

List all available reports, and then exit.

``-d YYYY-MM-DD, --date=YYYY-MM-DD``

Provide a date to run the report for.
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-reporter-0.1.tar.gz (8.3 kB) Copy SHA256 Checksum SHA256 Source Apr 2, 2010

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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