Package: shoobx.rml2odt
This library implements a converter from Reportlabs RML format to
Libreoffices/Open Document Formats ODT format utilizing thez3c.rmlparser andodfpylibrary.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.InstallingInstall with:$ pip install shoobx.rml2odtUsageThere is three ways of using shoobx.rml2odt.From the command lineInstalling shoobx.rml2odt will install a script that can be used from the
command line:rml2odt <infile> <outfile>Converting files from PythonYou 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 PythonIf 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)CHANGES0.8.0 (2020-12-08)Upgrade to py3.7+Changes for z3c.rml 4+ dependency0.7.1 (2020-02-26)Add support for nested lists with different styling than parent0.7.0 (2019-08-19)Add minor support forkeepTogethertags, always displaying contents and
keeping direct childblockTableelements on the same page0.6.1 (2019-08-16)Add support forspanStyletags.Add support forunderlineattribute isparaStyleandspanStyletags.0.6.0 (2019-04-12)Complete overhaul of blockTable styling.
This enables the use blockTableStyle andtdstyling tags.
Most text, background and border styling is supported.0.5.0 (2019-04-05)Fix:imgmust be in a Paragraph otherwise LibreOffice will not show the
ImageCode cleanup and refactorLots of fixes, cleanup, tests addedFix: blockSpan handling was completely brokenFix: Removed whitespace fromparaleft text,
removed tail text ofparatagFix:NextPagedid not work, it added no page breakFix: Do not add tabs to the ODT output, reportlab does not either.
There’s a specialtabtag that is used by our custom numbering.Fix: Do not fail on missingvalueof thecolortagFix: Supportpreandxpretags, make sure whitespace is not squashedFix: Copy themainorMainpageTemplate toStandardto make ODT
at least somehow happy. Reportlab usesmainas 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 ignoredvalueas startFix: support all customlibullets (l, L, o, O, r, R)0.4.2 (2019-03-20)Fix: thebrtag used a class variable to remember whether it added the
styleBreakJustify.Fixspantag 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 versaConvert tables in lists to lists in listsSupport for blockSpan in table styles.Handle tail text of commentsSupporting RML blockSpan styles for tablesTake the maximum, not the first when calculating the number of columns0.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, olStylesheets: paraStylePage LayoutInitial Release