Spaces:
Sleeping
Sleeping
| import pdfplumber | |
| import pandas as pd | |
| def extract_bhel_table(pdf_file): | |
| """Extracts structured tabular data specific to BHEL POs.""" | |
| rows = [] | |
| with pdfplumber.open(pdf_file) as pdf: | |
| for page in pdf.pages: | |
| table = page.extract_table() | |
| if table: | |
| rows.extend(table[1:]) # Skip header row | |
| columns = ["Sl No", "Material Description", "Unit", "Quantity", "Dely Qty", "Dely Date", "Unit Rate", "Value"] | |
| df = pd.DataFrame(rows, columns=columns) | |
| return df | |