Odfdo

Latest version: v3.9.4

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

3.9.4

Fix a performance bug on huge .ods tables when number of rows is a large (several thousand).
See issue 46 for a table of about ~83k. Table.traverse() on such a table is expected to be ~2 sec.

Changed

- Rewrite the method Table.traverse()

Fixed

- Fix the performance bug on huge .ods tables (issue 46)

3.9.3

Add support for Python 3.13 final in test suite.

Added

- Add support for Python3.13 in tox.ini

3.9.2

Add support for Python 3.13.0.rc3 in test suite.

Added

- Add support for Python3.13.0.rc3 in tox.ini, add requirement for lxml version 5.3 or higher for Python 3.13.

3.9.1

When creating a Document() allow alias "odt" for "Text", "ods" for "spreadsheet".

Add a recipe showing how to remove parts from a text document.

Added

- Aliases "odt", "ods", "odp" and "odg" for Document creation.

- Add recipe `delete_parts_of_a_text_document.py`

3.9.0

Two changes in this version:

- Fix of the broken `Table.displayed` property.
- Fix the way spaces are represented for better compliance with the ODF standard and word processors.

The `Table.displayed` property was broken and is removed. The functionality is replaced by the `Document.get_table_displayed` and `Document.set_table_displayed` methods. This change should not affect anyone since the previous implementation was unusable.

In previous version 3 spaces were translated into 1 space followed by `'<text:s text:c="2"/>'` unconditionally. However, the standard specifies that at the beginning and end of a paragraph spaces must be discarded by word processors, so 3 spaces should be coded `'<text:s text:c="3"/>'` and a single space as `'<text:s/>'`. This change should fix the bug of "disappearing" spaces at the beginning of paragraphs.

Added

- Methods Document.get_table_displayed(), Document.set_table_displayed(), Document.get_table_style().

- The Spacer() class has 2 new properties: Spacer.length and Spacer.text.

Changed

- XML generation of spaces at beginning and end of Paragraph content.

- Update of dependency versions.

Removed

- Table.displayed property.

Fixed

- Fix the "disappearing" spaces at the beginning of paragraphs bug.

3.8.0

Changed the default behavior for appending text to a `Paragraph`: the behavior of the `Paragraph.append_plain_text()` method is now the default. A `"formatted"` argument is added, `True` by default, which applies the recognition of "\n", "\t" or a sequence of several spaces and converts them to ODF tags (`text:line-break`, `text:tab`, `text:s`)). To ignore this text formatting, set `"formatted=False"`.

This change affects you if you create paragraphs from text containing line breaks or tabs and you don't want them to appear. In this case, add the argument `"formatted=False"`

Details:

- `Paragraph("word1 word2")`

- previous behavior:
- product XML: `'<text:p>word1 word2</text:p>'`
- expected display: `word1 word2` (single space, the ODF standard does not recognize space sequences)

- new behavior:
- product XML: `'<text:p>word1 <text:s text:c="4"/>word2</text:p>'`
- expected display: `word1 word2` (5 spaces)

- `Paragraph("word1 word2", formatted=False)`

- new behavior:
- product XML: `'<text:p>word1 word2</text:p>'`
- expected display: `word1 word2`

- `Paragraph("word1\nword2")`

- previous behavior:
- product XML: `'<text:p>word1\nword2</text:p>'`
- expected display: `word1 word2` (single space, the ODF standard does not recognize "\n" in XML content)

- new behavior:
- product XML: `'<text:p>word1<text:line-break/>word2</text:p>'`
- expected display:

word1
word2


- `Paragraph("word1\nword2", formatted=False)`

- new behavior:
- product XML: `'<text:p>word1 word2</text:p>'`
- expected display: `word1 word2`

On the same principle the `"formatted"` argument is available for `Pararaph.append(text)`, `Header(text)`, `Span(text)`.

The `Paragraph.append_plain_text(text)` method is retained for compatibility with previous versions and has the same behavior as `Paragraph.append(text, formatted=True)`, the default.

Changed

- `Paragraph()`, `Paragraph.append()` and subclasses `Header()` and `Span()` have a new `"formatted"` argument True by default that translates into ODF format "\n", "\t" and multiples spaces.

- Updating dependency versions.

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.