怎么用python_docx提取docx的一级标题,二级标题?

需要将一份docx文档中文字,按照正文,一级标题,二级标题,页眉,页脚这些分类,将内容提取出来,生成为python对象,这个要怎么搞啊?
如果有大佬知道,麻烦可以给我讲一下么?
或者点拨我一下也可以?
麻烦了

file = Document(path)
para = 段落编号
输入:

print(file.paragraphs[para].style.name)

输出:Heading 2
标题一览表可参见:https://python-docx.readthedocs.io/en/latest/api/enum/WdBuiltinStyle.html

https://www.jianshu.com/p/3380d91264f7