add partnum to parsing

This commit is contained in:
2024-02-17 20:31:43 -06:00
parent b5b2a936c1
commit 523915feb0
2 changed files with 8 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ import io
import json
from util import fprint
def parse(filename, output_dir):
def parse(filename, output_dir, partnum):
# Extract table data
@@ -165,6 +165,10 @@ def parse(filename, output_dir):
fprint(tables)
# summary
tables["partnum"] = partnum
with open(output_dir + "/tables.json", 'w') as json_file:
json.dump(tables, json_file)
@@ -177,4 +181,4 @@ def parse(filename, output_dir):
if __name__ == "__main__":
parse("test2.pdf", "10GXS13")
parse("test2.pdf", "cables/10GXS13", "10GXS13")