Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25174

ANN: PollyReports 1.5 -- Band-oriented PDF Report Generator

Path csiph.com!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <chris@newcenturycomputers.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; '(at': 0.03; 'importing': 0.04; 'source.': 0.05; 'canvas': 0.07; 'desired.': 0.07; 'subject:ANN': 0.07; 'python': 0.09; 'activity.': 0.09; 'bsd': 0.09; 'modules.': 0.09; 'received:184.172': 0.09; 'tuple': 0.09; 'url:github': 0.09; 'work"': 0.09; '(like': 0.15; 'producing': 0.15; '(note:': 0.16; 'element,': 0.16; 'expects': 0.16; 'flurry': 0.16; 'iterator': 0.16; 'least,': 0.16; 'one)': 0.16; 'row': 0.16; 'subject:oriented': 0.16; 'element': 0.17; 'module': 0.19; 'define': 0.20; 'import': 0.21; 'not,': 0.21; 'assumes': 0.22; 'from:addr:chris': 0.22; 'noted': 0.22; 'produces': 0.22; 'elements': 0.23; "i've": 0.23; 'least': 0.25; 'header:User- Agent:1': 0.26; 'common': 0.26; 'fit': 0.26; 'possibly': 0.27; 'first.': 0.27; 'i.e.': 0.27; 'label': 0.27; 'operations,': 0.27; 'possible,': 0.27; 'set.': 0.27; 'chris': 0.28; 'decide': 0.28; 'record': 0.28; 'idea,': 0.29; 'objects': 0.29; 'source': 0.29; 'classes': 0.30; 'framework': 0.30; 'returned': 0.30; 'expect': 0.31; 'url:python': 0.32; 'file': 0.32; 'print': 0.32; 'subject: -- ': 0.33; 'handle': 0.33; 'anyone': 0.33; 'to:addr:python-list': 0.33; '(c)': 0.33; 'that,': 0.34; 'list': 0.35; 'there': 0.35; 'really': 0.36; 'created': 0.36; 'but': 0.36; 'url:org': 0.36; 'data.': 0.36; 'generation': 0.36; 'method': 0.36; 'should': 0.36; 'problems': 0.36; 'turn': 0.36; 'pdf': 0.37; 'being': 0.37; 'detail': 0.37; 'item': 0.37; 'quite': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'brief': 0.38; 'object': 0.38; 'things': 0.38; 'talk': 0.38; 'sure': 0.38; 'page': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'list,': 0.39; 'where': 0.40; 'skip:" 10': 0.40; 'subject:-': 0.40; 'header:Received:5': 0.40; 'days': 0.60; 'most': 0.61; 'first': 0.61; 'received:216': 0.62; 'course.': 0.62; 'more': 0.63; 'here': 0.65; 'license': 0.65; 'received:67.18': 0.65; 'finally': 0.66; 'overall': 0.66; 'phone': 0.68; 'records': 0.68; 'computers': 0.69; 'url:4': 0.72; 'owner,': 0.78; 'band.': 0.84; 'century': 0.84; 'dict,': 0.84; 'generation,': 0.84; 'generation.': 0.84; 'url:cat': 0.84; 'announcing': 0.91; 'insane': 0.93; 'subject:Report': 0.93
Date Wed, 11 Jul 2012 09:06:10 -0500
From Chris Gonnerman <chris@newcenturycomputers.net>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version 1.0
To python-list@python.org
Subject ANN: PollyReports 1.5 -- Band-oriented PDF Report Generator
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - gator191.hostgator.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - newcenturycomputers.net
X-BWhitelist no
X-Source
X-Source-Args
X-Source-Dir
X-Source-Sender ([10.0.0.20]) [216.146.253.37]:53100
X-Source-Auth chris@newcenturycomputers.net
X-Email-Count 1
X-Source-Cap bmV3Y2VudDtuZXdjZW50O2dhdG9yMTkxLmhvc3RnYXRvci5jb20=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2012.1342016174.4697.python-list@python.org> (permalink)
Lines 63
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1342016174 news.xs4all.nl 6937 [2001:888:2000:d::a6]:34689
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:25174

Show key headers only | View raw


I've held off announcing this until I was sure it was really stable; 
it's been 19 days since I made the last change to it, so here goes. 
PollyReports is my Python module for report generation. It is designed 
to be, quite literally, the "simplest thing that can possibly work" in 
the field of PDF generation from a database record set.  There is a 
somewhat vague resemblance to GeraldoReports; I had problems with 
Geraldo's pagination which led me to develop PollyReports in a brief 
flurry of intense activity.

It's on PyPI: http://pypi.python.org/pypi/PollyReports
and on Github: https://github.com/Solomoriah/PollyReports
and I have a blog where I talk about it (like anyone cares): 
http://opensource.gonnerman.org/?cat=4

Here's the README:

PollyReports.py
Copyright (c) 2012 Chris Gonnerman
All Rights Reserved
See the LICENSE file for more information. (Note: BSD licensed)
-----------------------------------------------------------------------------------------

PollyReports.py provides a set of classes for database report writing.  
It assumes that you are using Reportlab to do PDF generation, but can 
work with any "canvas-like" object as desired.

PollyReports provides the following framework for report generation:

A Report object has a data source bound to it at instantiation.  One or 
more Band objects (at least, a detail Band) must be added to it, and 
then the generate() method will be called to process the data source.  
The data source
must be an iterator that produces objects that can be accessed via [] 
operations, meaning mainly dict, list, and tuple types, i.e. the most 
common types of records returned by standard database modules. The 
detail band is
generated() once for each row.

Band objects contain a list of Elements (generally at least one) which 
define how data from the row should be printed.  An Element may print 
any normal data item or label and may be subclassed to handle other 
things like images. Generating a band in turn calls Element.generate() 
for each element, producing a list of Renderers with the first item in 
the list being the overall height of the band.  The height is used to 
decide if the band will fit on the current page; if not, a new page will 
be created first.  When the page is finally ready for the band, 
Renderer.render() will be called for each Renderer in the element list 
in order to actually render the data.

As noted above, PollyReports expects a Reportlab-like canvas interface.  
The module has been kept as clean as possible, so that, though I don't 
actually recommend it, it would not be insane to say

     from PollyReports import *

Importing only what you expect to use is still a better idea, of course.

-- 
-------------------------------------------------------------------------------
Chris Gonnerman <chris@newcenturycomputers.net>
Owner, New Century Computers
Phone 660-213-3822   Fax 660-213-3339

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

ANN: PollyReports 1.5 -- Band-oriented PDF Report Generator Chris Gonnerman <chris@newcenturycomputers.net> - 2012-07-11 09:06 -0500

csiph-web