Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ Thumbs.db

# Cache files
__pycache__/
*.pyc
*.pyc

# XML files
*.xml
2 changes: 2 additions & 0 deletions boneset-api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions data_extraction/Extract_Bone_Descriptions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import xml.etree.ElementTree as ET
import json
import os
import argparse
import sys

slides_dir = "ppt/slides"
output_filename = "all_bone_descriptions.json"

def extract_descriptions_from_slide(xml_file): # Extract descriptions from a single slide XML file
try:
tree = ET.parse(xml_file)
Expand Down Expand Up @@ -206,4 +208,13 @@ def process_all_slides(ppt_dir, output_dir):

os.makedirs(args.output_dir, exist_ok=True)
success = process_all_slides(args.ppt_dir, args.output_dir)
sys.exit(0 if success else 1)
sys.exit(0 if success else 1)
with open(output_json_path, 'w') as f:
json.dump(bone_data, f, indent=4)

print(f"Descriptions saved to {output_json_path}")

# Example usage
xml_file = "/Users/joshbudzynski/Downloads/example_folder/ppt/slides/slide3.xml"
output_json = "slide3_Descriptions.json"
parse_slide_xml(xml_file, output_json)
Loading