Update 'src/find-missing-from-docx.py'

This commit is contained in:
Fred Boniface 2024-02-16 14:18:12 +00:00
parent e0781ade05
commit 2cba93e8bb
1 changed files with 16 additions and 5 deletions

View File

@ -1,11 +1,15 @@
### EXAMPLE CODE ONLY:::
### This uses the 'python-docx-2023' module
from docx import Document
def extract_table(file_path):
document = Document(file_path)
print(document.tables)
table = document.tables[0]
table = document.tables[4]
print(document.tables[1])
print(document.tables[2])
print(document.tables[3])
print(document.tables[4])
print(document.tables[5])
data = []
keys = None
@ -20,4 +24,11 @@ def extract_table(file_path):
print(data)
if __name__ == "__main__":
extract_table("./file.docx")
extract_table("./file.docx")
### This can parse each table. What needs to happen next
### is to parse all tables, then check for a PIS code.
### If PIS code exists, then find the associated headcode,
### Then an API request can be made to OwlBoard to try
### and find a service with valid stopping pattern,
### then the PIS codes can be generated for review.