Skip to main content
https://github.com/Shoobx/shoobx.rml2odt/actions/workflows/test.yml/badge.svg https://coveralls.io/repos/github/Shoobx/shoobx.rml2odt/badge.svg?branch=master https://img.shields.io/pypi/v/shoobx.rml2odt.svg https://img.shields.io/pypi/pyversions/shoobx.rml2odt.svg Maintainability

This library implements a converter from Reportlabs RML format to Libreoffices/Open Document Formats ODT format utilizing the z3c.rml parser and odfpy library.

It’s developed by Shoobx (https://shoobx.com) but is open source, and we are happy to accept outside contributions. See DEVELOPMENT.rst for more information.

Installing

Install with:

$ pip install shoobx.rml2odt

Usage

There is three ways of using shoobx.rml2odt.

From the command line

Installing shoobx.rml2odt will install a script that can be used from the command line:

rml2odt <infile> <outfile>

Converting files from Python

You can import shoobx.rml2odt as a library and convert files from Python:

>>> from shoobx.rml2odt import rml2odt
>>> rml2odt.convertFile(infilepath, outfilepath)

which will convert the file at infilepath and create the ODT file at outfilepath.

Converting an RML string in Python

If your RML data isn’t in a file, but is held in a string, you can import shoobx.rml2odt as a library and convert text data from Python:

>>> from shoobx.rml2odt import rml2odt
>>> odt_data = rml2odt.convertString(inputstring).read()
>>> with open(outputfile, 'wb') as output:
...     output.write(odt_data)

CHANGES

0.9.0 (2025-02-27)

  • Moving CI to github actions

  • Python 3.9, 3.10, 3.11 compatibility

0.8.0 (2020-12-08)

  • Upgrade to py3.7+

  • Changes for z3c.rml 4+ dependency

0.7.1 (2020-02-26)

  • Add support for nested lists with different styling than parent

0.7.0 (2019-08-19)

  • Add minor support for keepTogether tags, always displaying contents and keeping direct child blockTable elements on the same page

0.6.1 (2019-08-16)

  • Add support for spanStyle tags.

  • Add support for underline attribute is paraStyle and spanStyle tags.

0.6.0 (2019-04-12)

  • Complete overhaul of blockTable styling. This enables the use blockTableStyle and td styling tags. Most text, background and border styling is supported.

0.5.0 (2019-04-05)

  • Fix: img must be in a Paragraph otherwise LibreOffice will not show the Image

  • Code cleanup and refactor

  • Lots of fixes, cleanup, tests added

  • Fix: blockSpan handling was completely broken

  • Fix: Removed whitespace from para left text, removed tail text of para tag

  • Fix: NextPage did not work, it added no page break

  • Fix: Do not add tabs to the ODT output, reportlab does not either. There’s a special tab tag that is used by our custom numbering.

  • Fix: Do not fail on missing value of the color tag

  • Fix: Support pre and xpre tags, make sure whitespace is not squashed

  • Fix: Copy the main or Main pageTemplate to Standard to make ODT at least somehow happy. Reportlab uses main as conventional default. This is still just a workaround. Supporting custom templates set in a story will take more efforts.

  • Copied all z3c.rml RML test inputs, blacklisted a lot, listed shortcomings.

0.4.4 (2019-03-26)

  • Fix: Next paragraph text strip for custom bullets broken by 0.4.3.

0.4.3 (2019-03-26)

  • Fix: bullet numbering ignored value as start

  • Fix: support all custom li bullets (l, L, o, O, r, R)

0.4.2 (2019-03-20)

  • Fix: the br tag used a class variable to remember whether it added the style BreakJustify.

  • Fix span tag handling. It literally discarded most text.

0.4.1 (2019-03-19)

  • Fix: Text following a comment tag was discarded.

  • Fix: 3+ whitespace was replaced with nothing. Caused text to miss spaces.

0.4.0 (2018-01-23)

  • More indentation fixes.

  • Added support for O format lists (First, Second, Third)

  • Add support to have bullet lists in number lists and vice versa

  • Convert tables in lists to lists in lists

  • Support for blockSpan in table styles.

  • Handle tail text of comments

  • Supporting RML blockSpan styles for tables

  • Take the maximum, not the first when calculating the number of columns

0.3.0 (2018-01-12)

  • Many many formatting fixes including an almost complete rewrite of list handling and list styles.

0.2.0 (2017-12-08)

  • Cleaned up the public API.

  • Added basic docs.

0.1.0 (2017-11-21)

  • Basic Support for:

    • Flowables: para, blockTable, hr, ul, ol

    • Stylesheets: paraStyle

    • Page Layout

  • Initial Release

Release files for shoobx.rml2odt 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shoobx.rml2odt 0.9.0
File Size Uploaded
shoobx.rml2odt-0.9.0.tar.gz 853.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shoobx.rml2odt 0.9.0
File Interpreter ABI Platform
shoobx.rml2odt-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.9 MB

Release files / shoobx.rml2odt-0.9.0.tar.gz

Download URL shoobx.rml2odt-0.9.0.tar.gz
Size 853.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a57f57869684b18b12a3f44165799dd481d882e3785799e06268b6d8fe01d21f
BLAKE2b-256 checksum
How to use checksums
8f72365a5a7898e6216066ba248c778b83fab7b35294857e913e45b930e4e8df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / shoobx.rml2odt-0.9.0-py3-none-any.whl

Download URL shoobx.rml2odt-0.9.0-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5651d54b29e8ca0a75739692f141763af38c5eb864b122b08a76eb119b8afc28
BLAKE2b-256 checksum
How to use checksums
720e9557e7c18fd1d91a6e2b933f955d43a20ebbde33fcbefb381ed761cffa35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page