Skip to main content

An easy solution to design reports using OpenOffice

Project description

Introduction

py3o is an elegant and scalable solution to design reports using LibreOffice or OpenOffice. py3o.template is the templating component that takes care of merging your datasets with a corresponding templated OpenOffice document.

It is plateform independant and does not require LibreOffice/OpenOffice itself to generate an ODF file. If you want to generate a PDF or any other support output format you will then need to have a server with either LibreOffice or OpenOffice and to install the py3o.renderserver on it.

Full Documentation

We provide a documentation for this package. If anything is not correctly explained, please! create a ticket in our ticketing system

Example Usage

Below is an example that you can find in the source tarball inside the examples directory.

from py3o.template import Template

t = Template("py3o_example_template.odt", "py3o_example_output.odt")

t.set_image_path('logo', 'images/new_logo.png')


class Item(object):
    pass

items = list()

item1 = Item()
item1.val1 = 'Item1 Value1'
item1.val2 = 'Item1 Value2'
item1.val3 = 'Item1 Value3'
item1.Currency = 'EUR'
item1.Amount = '12345.35'
item1.InvoiceRef = '#1234'
items.append(item1)

for i in xrange(1000):
    item = Item()
    item.val1 = 'Item%s Value1' % i
    item.val2 = 'Item%s Value2' % i
    item.val3 = 'Item%s Value3' % i
    item.Currency = 'EUR'
    item.Amount = '6666.77'
    item.InvoiceRef = 'Reference #%04d' % i
    items.append(item)

document = Item()
document.total = '9999999999999.999'

data = dict(items=items, document=document)
t.render(data)

Project details


Release history Release notifications

History Node

0.9.12

History Node

0.9.11

History Node

0.9.10

History Node

0.9.9

History Node

0.9.9.dev1

History Node

0.9.8

History Node

0.9.7

History Node

0.9.6

History Node

0.9.5

History Node

0.9.4

History Node

0.9.3

History Node

0.9.2

History Node

0.9.1

History Node

0.9

History Node

0.8

History Node

0.7

This version
History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.4dev

History Node

0.3

History Node

0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
py3o.template-0.6-py2.7.egg (13.7 kB) Copy SHA256 hash SHA256 Egg 2.7 Jun 18, 2014
py3o.template-0.6-py2-none-any.whl (10.1 kB) Copy SHA256 hash SHA256 Wheel 2.7 Jun 18, 2014
py3o.template-0.6.tar.gz (7.4 kB) Copy SHA256 hash SHA256 Source None Jun 18, 2014
py3o.template-0.6.zip (12.1 kB) Copy SHA256 hash SHA256 Source None Jun 18, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page