File size: 522 Bytes
80a9287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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