Skip to main content

An Office Open XML parser that outputs HTML.

Project description

OOXmilker is an Office Open XML parser that outputs HTML. It takes any Word (.docx, .docm), Excel (.xlsx, .xlsm), PowerPoint (pptx, pptm) or Visio (.vsdx, .vsdm)1 file as an input. It returns every paragraphs from the file, one after the other.

Installation:

This package can be installed using the following instruction in a console:

pip install ooxmilker

Usage:

Once the package installed, the module can be imported like so:

import ooxmilker

To use OOXmilker, make a call to read() function. This function takes a string representing the path to an Office Open XML file as argument. read() being a generator function, it must be part of some sort of loop.

For example, the following script prints each paragraph from a Word file.

file_path = "C:\\Documents and Settings\\Guest\\My Documents\\document.docx"
for p in ooxmilker.read(file_path):
    print(p[0])
    print(p[1])

Each iteration returns a tuple with 2 values. In the example above, value p[0] is a string containing a single paragraph from document.docx with some HTML tags. Value p[1] is a dictionary providing context information on the paragraph.

Key Possible Values Description
tbl True False If True, the content is located inside a table. Does not apply to Excel files.
chg True False If True, the content contains changes (insertions or deletions). Applies to Word files only.

Continuing with the same example, p[1].get("tbl") would either return a boolean True or False. If True, the paragraph is part of a table; if False, the paragraph is not part of a table.

Compatibility

OOXmilker needs Python 3.6 to work.

Features from Office Open XML format and their respective compatibility when using OOXmilker will be listed in the near future.

1. Visio is not part of the OOXML standard, but still close enough for OOXmilker.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ooxmilker-0.0.3.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ooxmilker-0.0.3-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file ooxmilker-0.0.3.tar.gz.

File metadata

  • Download URL: ooxmilker-0.0.3.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for ooxmilker-0.0.3.tar.gz
Algorithm Hash digest
SHA256 cc969f0f5e6de7fe7aaade5c6d821bbe70266cd48d114fb86ee5e428be306406
MD5 c26839f5fb63b80624c5db4a8e958db6
BLAKE2b-256 5f1a831b4d4731571cf491ed8454ee2533558755a3953f95b4f530d9b8ce32ec

See more details on using hashes here.

File details

Details for the file ooxmilker-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ooxmilker-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for ooxmilker-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ff587614ce1db47203dd3a11936f817d8b2b6e171d24f4ac7c4b7b7f93fe73f2
MD5 1417ba76c65eb847bf669a521b1bb3c5
BLAKE2b-256 c198e4820dced42e5b3ddb3f09b92c51e4ec22f8e261bc1b8e5b5cba0eb192a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page