last and final attempt to search for python ods library.

Krishnakant hackingkk at
Tue Mar 10 09:26:17 CET 2009

On Tue, 2009-03-10 at 00:27 -0400, Terry Reedy wrote:

> In any case, api-for-odfpy.odt has
I am going through the documentation for odfpy but finding it pritty
complex right now.
> 5.17.12 table.CoveredTableCell
> Requires the following attributes: No attribute is required.
> Allows the following attributes: booleanvalue, contentvalidationname, 
> currency, datevalue, formula, numbercolumnsrepeated, protect, 
> stringvalue, stylename, timevalue, value, valuetype.
> These elements contain table.CoveredTableCell: table.TableRow.
> The following elements occur in table.CoveredTableCell: dr3d.Scene, 
> draw.A, draw.Caption, ...
So merged cells are refered to as covered cells is it?
> so odfpy, at least, can create such elements.
Do you have any code sample done in odfpy which I can browse throu and
run it to see the results.

> > 
> > Here's an example of 2 merged ranges: A1:C2 contains the text "foo"
> > and D1:D2 contains "bar"
> > 
> > <table:table-row table:style-name="ro1">
> > - <table:table-cell table:style-name="ce1" office:value-type="string"
> > table:number-columns-spanned="3" table:number-rows-spanned="2">
> >   <text:p>foo</text:p>
> >   </table:table-cell>
> >   <table:covered-table-cell table:number-columns-repeated="2" />
> > - <table:table-cell table:style-name="ce1" office:value-type="string"
> > table:number-columns-spanned="1" table:number-rows-spanned="2">
> >   <text:p>bar</text:p>
> >   </table:table-cell>
> >   </table:table-row>
> > - <table:table-row table:style-name="ro1">
> >   <table:covered-table-cell table:number-columns-repeated="4" />
> >   </table:table-row>
> > 
> > Aside: If you are wondering where the cell addresses (D1 etc) are,
> > they're in the reader's current_row and current_col variables :-)
> > Perhaps this was intended to save space, but what of table:number-
> > columns-repeated="4" ??

I guess I got the point, but still can't figure out how I could actually
implement this because I find the documentation of odfpy pritty complex
and does not have the kind of example which shows what you explained in
the above code.

And the problem is that I got a bit confused in the above code because
my merging happens only in the top row and spanns columns not rows.

I would be very happy if I could get the code wich creates a set of
merged cells in a single row with some data in it.

I managed to do the odt part in the odfpy because the examples were
there and well documented.

happy hacking.

More information about the Python-list mailing list