Questions tagged [odfpy]
19 questions
23
votes
6 answers
ODFPy documentation
I need to manipulate the ODF file format (open document format, the open office's internal format), and I need to do it in Python.
It seem's ODFPy is a wonderful library for this purpose. Unfortunately the official documentation is very poor, almost…
Luca
5
votes
1 answer
Search and replace text odfpy
I'm trying to make reports for a program using odfpy. My idea is to search for each keywords like [[[e_mail_address]]] and replace it by a word from the database.
I found the function text in odfpy api, but converted into string looses the…

Maciek
- 183
- 1
- 8
2
votes
2 answers
odfpy: need to copy an existing table
I have an issue with odfpy and Python 3. I try to copy an existing table in an Opendocument Text file. I'm failing at getting the style information out of the original table. Here is my code:
# templateTable is a table.Table that has to be…

Cookie1980
- 108
- 7
1
vote
1 answer
Set border for table cell with odfpy
I created a Libre Office spreadsheet with odfpy and want some cells to have a border, but cannot figure out how to do that. I know that I can add style to a table cell and I know that TableCellProperties has an attribute called 'border'. I tried to…

pyQueen
- 191
- 2
- 10
1
vote
1 answer
Merge cells with odfpy
I created a Libre Office spreadsheet with odfpy:
from odf.opendocument import OpenDocumentSpreadsheet
from odf.table import Table, TableRow, TableCell
from odf.text import P
document = OpenDocumentSpreadsheet()
table =…

pyQueen
- 191
- 2
- 10
1
vote
2 answers
Add line in Writer (odt) document using odfpy
I am trying to insert an horizontal line in a LibreOffice Writer (odt) document using odfpy.
(In Writer: Menu->Insert->Horizontal line)
This is my attempt (adapting this example):
from odf import opendocument, chart, text, draw
drawdoc =…

user3733164
- 531
- 4
- 17
1
vote
1 answer
Get font type in python odfpy?
Have somebody experencies with odfpy ?
I parsed document with this python package and I got paragraphs with his text and stylenames, now I need to detect which type of text font is in this paragraphs text?
Do you have any ideas ?

bagere
- 221
- 5
- 17
0
votes
1 answer
Add Section to OpenDocument Text file with ODFpy
I am using Python2.7 and ODFpy to write an OpenDocument Text (ODT) file. Is there a way using the existing ODFpy API to add sections (a la Format->Sections...) to the document? Is there a way to import them from another document and then populate…

Keith Pinson
- 7,835
- 7
- 61
- 104
0
votes
1 answer
How to count the number of words in a .odt document?
I am trying to make a program that will go through all the folders and sub-folders, find all OpenOffice documents, open them and then count the words present in the file. The idea is to sum up the total later and output the total number of words…

Arvid Eriksson
- 3
- 2
0
votes
1 answer
How to create a Table in a OpenDocumentText document using odfpy
I would like to create a table in an odt (OpenDocumentText) file using odfpy?
The docu of the package is outdated and the project nearly orphaned (but maybe on its way back I think).
Be aware I don't mean Spreadsheet documents but text documents.

buhtz
- 10,774
- 18
- 76
- 149
0
votes
0 answers
how to extract the titles of a document .odt in Libreoffice - Python
I have a document in the .odt file,
I just want to extract the titles of this document :
in other words , I want to extract the "sentenses " or in others words "the "line" which are in bold in this documentdocument.odt :
my code :
from…

dkk
- 171
- 3
- 11
0
votes
1 answer
underline text with odfpy
I'd like to generate an odf file with odfpy, and am stuck on underlining text.
Here is a minimal example inspired from official documentation, where i can't find any information about what attributes can be used and where.
Any suggestion?
from…

spacm
- 190
- 3
- 18
0
votes
1 answer
How to count words in a Libre Office file using a script?
I am trying to write a script that takes a folder with X .odt files and compute the number of words. It has to write it in a csv file, with the date.
I tried to do it using odfpy.
import odf
import glob
import pandas as pd
import os
from…

Indetronable
- 63
- 7
0
votes
1 answer
Change the font on odfpy?
How can I change the font on odfpy for example, using Arial or comic sans. I've seen some examples but they only use the params "fontsize" and "fontweight". I can't find any example changing the font and the param "font" doesn't seem to work.

user3476016
- 1
- 1
0
votes
0 answers
Beginner Python 3 Manjaro Linux/Windows text auto formating project
This is my first project so I am not experienced. I am trying to make a program for my Mom that will download a recipe of off a website like jamiecooksitup.net, recognize sections of the recipe(description, ingredients, instructions) format…

BillbroSwaggins
- 1
- 1