Metadata-Version: 2.1
Name: mswordtree
Version: 0.1.1.5
Summary: Get the parsed microsoft word document in a hierarchical tree structure.
Home-page: https://github.com/imAliAsad/mswordtree
Author: Ali Asad
Author-email: imaliasad@outlook.com
License: MIT License
Keywords: docx office openxml word tree microsoft headings tables
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Office/Business :: Office Suites
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
Requires-Dist: pandas
Requires-Dist: python-docx
Requires-Dist: uuid

## mswordtree

Parse your whole word document in a hierarchical tree structure. The document content will be listed down as Heading and its children as subheading/paragraph/table etc.

Install the library using following comand

```
pip install mswordtree
```

Use the following code to parse your word document in a tree structure

```python
from mswordtree import GetWordDocTree
root = GetWordDocTree('test.docx')
```
Now you can iterate over all objects of the document by using the following code

```
for item in root.Items:
    print('Type: {} -> Content {}\n'.format(item.Type, item.Content))
```

To make the json use the following code

```python
from mswordtree import ToString
ToString([root])
```


### Common Methods

#### Find(guid)

Use the root element to find any element in its tree structure by mathing its GUID.

```python
item = root.Find('3b34509b-533e-40cc-b0dc-c44df5bcba51')
```

#### ToString_AllHeadings(root)

Returns the string of all heading elements in a tree structure, which we can use as a json string.

```python
from mswordtree import ToString_AllHeadings
import json

data = ToString_AllHeadings(root)
json.dumps(data)
```


