Geraldo is a reports engine with its own API, created in Python language to output PDFs and other formats for complex reports.
Its workflow is the following:
Geraldo does most of what any reports engine does. It provides the following features:
Geraldo is fully dependent on ReportLab, not only because of its PDF generation, but also its units and styles library. We have tested with ReportLab version 2.1
Geraldo is not Django-dependent, but it can work as a Django pluggable application.
from geraldo import Report, DetailBand, ObjectValue
from geraldo.utils import cm
from geraldo.generators import PDFGenerator
names = ['Mychelle', 'Leticia', 'Tarsila', 'Marta', 'Vera', 'Leni']
class MyReport(Report):
class band_detail(DetailBand):
height=0.7*cm
elements=[
ObjectValue(attribute_name='capitalize'),
]
report = MyReport(queryset=names)
report.generate_by(PDFGenerator, filename='female-names.pdf')
This code above will output your report, driven by the queryset ‘objects_list’, into file ‘cars_list.pdf’.
Now, an example in a Django view:
from django.http import HttpResponse
from geraldo import Report, DetailBand, ObjectValue
from geraldo.generators import PDFGenerator
from geraldo.utils import cm
class MyReport(Report):
class band_detail(DetailBand):
height=0.7*cm
elements=[
ObjectValue(attribute_name='username'),
]
def my_view(request):
response = HttpResponse(mimetype='application/pdf')
objects_list = User.objects.all() # If you are using Django
report = MyReport(queryset=objects_list)
report.generate_by(PDFGenerator, filename=response)
return response
As you can see, now returned the PDF output to HttpResponse, instead of a file.
Geraldo is under Lesser Gnu Public License, take a look on the following URL to read it:
http://www.gnu.org/copyleft/lesser.html
Geraldo has been created by Marinho Brandao a brazilian Django and Python enthusiast.
Home page: http://marinhobrandao.com/
E-mail: marinho at gmail dot com