This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zipfile | |
from lxml import etree | |
import pandas as pd | |
def read_docx(docx_file, **kwargs): | |
"""Read tables as DataFrames from a Word document | |
""" | |
ns = {'w': 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'} | |
with zipfile.ZipFile(docx_file).open('word/document.xml') as f: | |
root = etree.parse(f) |