Overview

docs Documentation Status
tests
Travis-CI Build Status AppVeyor Build Status Requirements Status
Coverage Status
package
PyPI Package latest release PyPI Wheel Supported versions Supported implementations
Commits since latest release

Creation and manipulation of Open XML documents (mainly docx).

  • Free software: MIT license

Features

This library allow you to:

  • Convert Open XML documents into flat OPC format.

Installation

pip install docx-utils

Using the library

Using the library to convert an Open XML document into flat OPC format:

>>> from docx_utils.flatten import opc_to_flat_opc
>>> opc_to_flat_opc("sample.docx", "sample.xml")

Command Line Interface (CLI)

Printing the online help:

$ docx_utils --help
Usage: docx_utils [OPTIONS] COMMAND [ARGS]...

  Docx utilities

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  flatten  Convert an Open XML document into flat OPC format.

Converting an Open XML document into flat OPC format:

$ docx_utils flatten sample.docx sample.xml
Converting 'sample.docx' to flat XML...
Conversion done: 'sample.xml'.

Development

To run the all tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows
set PYTEST_ADDOPTS=--cov-append
tox
Other
PYTEST_ADDOPTS=--cov-append tox