can you convert this to excel

Reading File
Reading File
Running Command

cd /home/daytona/workspace && python3 << 'EOF' import pdfplumber pdf_path = "/home/daytona/workspace/attachments/952c31eb-3f7d-4b4d-8116-84e39d5cb5a3/DIVYAM ARUNKUMAR AGRAWAL ITR AY 2025-26.pdf" with pdfplumber.open(pdf_path) as pdf: print(f"Total pages: {len(pdf.pages)}") for i, page in enumerate(pdf.pages): print(f"\n===== PAGE {i+1} =====") text = page.extract_text() if text: print(text[:3000]) tables = page.extract_tables() if tables: print(f"\n--- {len(tables)} table(s) found ---") for j, table in enumerate(tables): print(f"\nTable {j+1}:") for row in table: print(row) EOF

Running Command

python3 << 'EOF' import pdfplumber pdf_path = "/home/daytona/workspace/attachments/952c31eb-3f7d-4b4d-8116-84e39d5cb5a3/DIVYAM ARUNKUMAR AGRAWAL ITR AY 2025-26.pdf" with pdfplumber.open(pdf_path) as pdf: page = pdf.pages[0] # Try to get words with coordinates words = page.extract_words() print(f"Total words found: {len(words)}") for w in words[:50]: print(w) # Try chars chars = page.chars print(f"\nTotal chars: {len(chars)}") if chars: print("Sample chars:") for c in chars[:20]: print(c) EOF

Running Command

python3 << 'EOF' # Convert PDF page to image and run OCR from pdf2image import convert_from_path import pytesseract pdf_path = "/home/daytona/workspace/attachments/952c31eb-3f7d-4b4d-8116-84e39d5cb5a3/DIVYAM ARUNKUMAR AGRAWAL ITR AY 2025-26.pdf" images = convert_from_path(pdf_path, dpi=200) print(f"Converted {len(images)} page(s)") for i, img in enumerate(images): text = pytesseract.image_to_string(img, config='--psm 6') print(f"\n===== PAGE {i+1} OCR OUTPUT =====") print(text[:5000]) EOF

Running Command

python3 << 'EOF' import openpyxl from openpyxl.styles import Font, PatternFill, Alignment, Border, Side from openpyxl.utils import get_column_letter import os os.makedirs("/home/daytona/workspace/itr-excel", exist_ok=True) wb = openpyxl.Workbook() ws = wb.active ws.title = "ITR Acknowledgement" # Colors header_fill = PatternFill(start_color="1F4E79", end_color="1F4E79", fill_type="solid") section_fill = PatternFill(start_color="BDD7EE", end_color="BDD7EE", fill_type="solid") alt_fill = PatternFill(start_color="EBF3FB", end_color="EBF3FB", fill_type="solid") white_fill = PatternFill(start_color="FFFFFF", end_color="FFFFFF", fill_type="solid") highlight_fill = PatternFill(start_color="FFF2CC", end_color="FFF2CC", fill_type="solid") green_fill = PatternFill(start_color="E2EFDA", end_color="E2EFDA", fill_type="solid") red_fill = PatternFill(start_color="FCE4D6", end_color="FCE4D6", fill_type="solid") header_font = Font(name="Arial", bold=True, color="FFFFFF", size=12) title_font = Font(name="Arial", bold=True, color="1F4E79", size=14) section_font = Font(name="Arial", bold=True, color="1F4E79", size=11) label_font = Font(name="Arial", bold=True, size=10) value_font = Font(name="Arial", size=10) amount_font = Font(name="Arial", size=10, bold=True) thin = Side(style="thin", color="AAAAAA") medium = Side(style="medium", color="1F4E79") thin_border = Border(left=thin, right=thin, top=thin, bottom=thin) medium_border = Border(left=medium, right=medium, top=medium, bottom=medium) def set_cell(ws, row, col, value, font=None, fill=None, alignment=None, border=None, number_format=None): cell = ws.cell(row=row, column=col, value=value) if font: cell.font = font if fill: cell.fill = fill if alignment: cell.alignment = alignment if border: cell.border = border if number_format: cell.number_format = number_format return cell center = Alignment(horizontal="center", vertical="center", wrap_text=True) left = Alignment(horizontal="left", vertical="center", wrap_text=True) right = Alignment(horizontal="right", vertical="center") # ---- ROW 1: Main Title ---- ws.merge_cells("A1:D1") set_cell(ws, 1, 1, "INDIAN INCOME TAX RETURN ACKNOWLEDGEMENT", font=Font(name="Arial", bold=True, color="FFFFFF", size=14), fill=header_fill, alignment=center) # ---- ROW 2: Subtitle ---- ws.merge_cells("A2:D2") set_cell(ws, 2, 1, "Assessment Year: 2025-26 | Form: ITR-2", font=Font(name="Arial", bold=True, color="FFFFFF", size=11), fill=header_fill, alignment=center) ws.row_dimensions[1].height = 30 ws.row_dimensions[2].height = 22 # ---- SECTION 1: Acknowledgement Info ---- row = 4 ws.merge_cells(f"A{row}:D{row}") set_cell(ws, row, 1, "ACKNOWLEDGEMENT DETAILS", font=section_font, fill=section_fill, alignment=left, border=thin_border) ws.row_dimensions[row].height = 20 row += 1 ack_details = [ ("Acknowledgement Number", "527787030060925"), ("Date of Filing", "06-Sep-2025"), ("Income Tax Return Transmitted On", "06-Sep-2025 15:13:00"), ("Verified On", "09-Sep-2025"), ("IP Address", "117.223.195.40"), ("Verification Method", "Electronic Verification Code (EVC) via Aadhaar OTP"), ("EVC Code", "EBB1FE7121"), ] for i, (label, value) in enumerate(ack_details): fill = alt_fill if i % 2 == 0 else white_fill set_cell(ws, row, 1, label, font=label_font, fill=fill, alignment=left, border=thin_border) ws.merge_cells(f"B{row}:D{row}") set_cell(ws, row, 2, value, font=value_font, fill=fill, alignment=left, border=thin_border) ws.row_dimensions[row].height = 18 row += 1 # ---- SECTION 2: Taxpayer Details ---- row += 1 ws.merge_cells(f"A{row}:D{row}") set_cell(ws, row, 1, "TAXPAYER DETAILS", font=section_font, fill=section_fill, alignment=left, border=thin_border) ws.row_dimensions[row].height = 20 row += 1 taxpayer_details = [ ("PAN", "CAWPA4355E"), ("Name", "DIVYAM ARUNKUMAR AGRAWAL"), ("Address", "06 ARUNODAY, AMRAPALI SOCIETY, DAHOD, Dahod, Gujarat - 389151, India"), ("Status", "Individual"), ("Form Number", "ITR-2"), ("Filed Under Section", "139(1) - On or before due date"), ("e-Filing Acknowledgement Number", "527787030060925"), ] for i, (label, value) in enumerate(taxpayer_details): fill = alt_fill if i % 2 == 0 else white_fill set_cell(ws, row, 1, label, font=label_font, fill=fill, alignment=left, border=thin_border) ws.merge_cells(f"B{row}:D{row}") set_cell(ws, row, 2, value, font=value_font, fill=fill, alignment=left, border=thin_border) ws.row_dimensions[row].height = 18 row += 1 # ---- SECTION 3: Tax Computation ---- row += 1 ws.merge_cells(f"A{row}:D{row}") set_cell(ws, row, 1, "TAX COMPUTATION SUMMARY", font=section_font, fill=section_fill, alignment=left, border=thin_border) ws.row_dimensions[row].height = 20 row += 1 # Sub-headers for col, header in enumerate(["Sl. No.", "Description", "Schedule", "Amount (₹)"], 1): set_cell(ws, row, col, header, font=Font(name="Arial", bold=True, color="FFFFFF", size=10), fill=PatternFill(start_color="2E75B6", end_color="2E75B6", fill_type="solid"), alignment=center, border=thin_border) ws.row_dimensions[row].height = 18 row += 1 tax_data = [ (1, "Current Year Business Loss, if any", "1", 0), (2, "Total Income", "1A", 989330), (3, "Book Profit under MAT, where applicable", "2", 0), (4, "Adjusted Total Income under AMT, where applicable", "3", 989330), (5, "Net Tax Payable", "4", 98793), (6, "Interest and Fee Payable", "5", 0), (7, "Total Tax, Interest and Fee Payable", "6", 98793), (8, "Taxes Paid", "7", 108288), (9, "Tax Payable / (-) Refundable [6 - 7]", "8", -9500), (10, "Accreted Income as per Section 115TD", "9", 0), (11, "Additional Tax Payable u/s 115TD", "10", 0), (12, "Interest Payable u/s 115TE", "11", 0), (13, "Additional Tax and Interest Payable", "12", 0), (14, "Tax and Interest Paid", "13", 0), (15, "Tax Payable / (-) Refundable [12 - 13]", "14", 0), ] for i, (sl, desc, sched, amt) in enumerate(tax_data): fill = alt_fill if i % 2 == 0 else white_fill # Special highlighting for key rows if sl == 2: # Total Income fill = PatternFill(start_color="DDEBF7", end_color="DDEBF7", fill_type="solid") elif sl == 7: # Total Tax Payable fill = PatternFill(start_color="DDEBF7", end_color="DDEBF7", fill_type="solid") elif sl == 9: # Refund row fill = green_fill set_cell(ws, row, 1, sl, font=value_font, fill=fill, alignment=center, border=thin_border) set_cell(ws, row, 2, desc, font=label_font if sl in [2,7,8,9] else value_font, fill=fill, alignment=left, border=thin_border) set_cell(ws, row, 3, sched, font=value_font, fill=fill, alignment=center, border=thin_border) # Format amount amt_cell = set_cell(ws, row, 4, amt, font=amount_font if sl in [2,5,7,8,9] else value_font, fill=fill, alignment=right, border=thin_border) amt_cell.number_format = '#,##0;(#,##0);"-"' if sl == 9: amt_cell.font = Font(name="Arial", bold=True, color="006400", size=10) ws.row_dimensions[row].height = 18 row += 1 # ---- SECTION 4: Note ---- row += 1 ws.merge_cells(f"A{row}:D{row}") set_cell(ws, row, 1, "NOTE: This is a computer-generated acknowledgement. Do NOT send this acknowledgement to CPC, Bengaluru.", font=Font(name="Arial", italic=True, size=9, color="7F7F7F"), fill=highlight_fill, alignment=left) ws.row_dimensions[row].height = 18 row += 1 ws.merge_cells(f"A{row}:D{row}") set_cell(ws, row, 1, "QR/Barcode Data: CAWPA4355E025277870300609251e280f191779282ced2fab45f3d87369b51c711c", font=Font(name="Arial", italic=True, size=9, color="7F7F7F"), fill=white_fill, alignment=left) ws.row_dimensions[row].height = 18 # ---- Column Widths ---- ws.column_dimensions["A"].width = 8 ws.column_dimensions["B"].width = 50 ws.column_dimensions["C"].width = 12 ws.column_dimensions["D"].width = 18 # ---- Freeze panes ---- ws.freeze_panes = "A5" # ---- Save ---- out_path = "/home/daytona/workspace/itr-excel/DIVYAM_ARUNKUMAR_AGRAWAL_ITR_AY2025-26.xlsx" wb.save(out_path) print(f"Saved: {out_path}") EOF

Running Command

ls -la /home/daytona/workspace/itr-excel/ && df -h /home/daytona/workspace/

Running Command

ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/itr-excel && ls -la /home/daytona/workspace/itr-excel/

Running Command

python3 -c " import openpyxl from openpyxl.styles import Font, PatternFill, Alignment, Border, Side from openpyxl.utils import get_column_letter wb = openpyxl.Workbook() ws = wb.active ws.title = 'ITR Acknowledgement' # Colors hdr_fill = PatternFill(start_color='1F4E79', end_color='1F4E79', fill_type='solid') sec_fill = PatternFill(start_color='BDD7EE', end_color='BDD7EE', fill_type='solid') alt_fill = PatternFill(start_color='EBF3FB', end_color='EBF3FB', fill_type='solid') wht_fill = PatternFill(start_color='FFFFFF', end_color='FFFFFF', fill_type='solid') grn_fill = PatternFill(start_color='E2EFDA', end_color='E2EFDA', fill_type='solid') blu_fill = PatternFill(start_color='DDEBF7', end_color='DDEBF7', fill_type='solid') yel_fill = PatternFill(start_color='FFF2CC', end_color='FFF2CC', fill_type='solid') sub_fill = PatternFill(start_color='2E75B6', end_color='2E75B6', fill_type='solid') thin = Side(style='thin', color='AAAAAA') tb = Border(left=thin, right=thin, top=thin, bottom=thin) ctr = Alignment(horizontal='center', vertical='center', wrap_text=True) lft = Alignment(horizontal='left', vertical='center', wrap_text=True) rgt = Alignment(horizontal='right', vertical='center') def sc(r, c, v, fnt=None, fl=None, al=None, br=None, nf=None): cell = ws.cell(row=r, column=c, value=v) if fnt: cell.font = fnt if fl: cell.fill = fl if al: cell.alignment = al if br: cell.border = br if nf: cell.number_format = nf return cell # Title rows ws.merge_cells('A1:D1') sc(1,1,'INDIAN INCOME TAX RETURN ACKNOWLEDGEMENT', Font(name='Arial',bold=True,color='FFFFFF',size=13), hdr_fill, ctr) ws.merge_cells('A2:D2') sc(2,1,'Assessment Year: 2025-26 | Form Number: ITR-2', Font(name='Arial',bold=True,color='FFFFFF',size=11), hdr_fill, ctr) ws.row_dimensions[1].height = 28 ws.row_dimensions[2].height = 20 # Section 1: Ack Details r = 4 ws.merge_cells(f'A{r}:D{r}') sc(r,1,'ACKNOWLEDGEMENT DETAILS', Font(name='Arial',bold=True,color='1F4E79',size=11), sec_fill, lft, tb) ws.row_dimensions[r].height = 20 r += 1 ack = [ ('Acknowledgement Number','527787030060925'), ('Date of Filing','06-Sep-2025'), ('ITR Transmitted On','06-Sep-2025 15:13:00'), ('Verified On','09-Sep-2025'), ('Transmission IP Address','117.223.195.40'), ('Verification Method','Electronic Verification Code (EVC) via Aadhaar OTP'), ('EVC Code','EBB1FE7121'), ] for i,(lbl,val) in enumerate(ack): fl = alt_fill if i%2==0 else wht_fill sc(r,1,lbl,Font(name='Arial',bold=True,size=10),fl,lft,tb) ws.merge_cells(f'B{r}:D{r}') sc(r,2,val,Font(name='Arial',size=10),fl,lft,tb) ws.row_dimensions[r].height = 17 r += 1 # Section 2: Taxpayer r += 1 ws.merge_cells(f'A{r}:D{r}') sc(r,1,'TAXPAYER DETAILS', Font(name='Arial',bold=True,color='1F4E79',size=11), sec_fill, lft, tb) ws.row_dimensions[r].height = 20 r += 1 tp = [ ('PAN','CAWPA4355E'), ('Full Name','DIVYAM ARUNKUMAR AGRAWAL'), ('Address','06 ARUNODAY, AMRAPALI SOCIETY, DAHOD, Dahod, Gujarat - 389151, India'), ('Taxpayer Status','Individual'), ('Form Number','ITR-2'), ('Filed Under Section','139(1) - On or before due date'), ] for i,(lbl,val) in enumerate(tp): fl = alt_fill if i%2==0 else wht_fill sc(r,1,lbl,Font(name='Arial',bold=True,size=10),fl,lft,tb) ws.merge_cells(f'B{r}:D{r}') sc(r,2,val,Font(name='Arial',size=10),fl,lft,tb) ws.row_dimensions[r].height = 17 r += 1 # Section 3: Tax Computation r += 1 ws.merge_cells(f'A{r}:D{r}') sc(r,1,'TAX COMPUTATION SUMMARY (Amount in INR)', Font(name='Arial',bold=True,color='1F4E79',size=11), sec_fill, lft, tb) ws.row_dimensions[r].height = 20 r += 1 for col,hdr in enumerate(['Sl. No.','Description','Schedule Ref.','Amount (INR)'],1): sc(r,col,hdr,Font(name='Arial',bold=True,color='FFFFFF',size=10),sub_fill,ctr,tb) ws.row_dimensions[r].height = 18 r += 1 tax_rows = [ (1,'Current Year Business Loss, if any','1',0,False), (2,'Total Income','1A',989330,True), (3,'Book Profit under MAT, where applicable','2',0,False), (4,'Adjusted Total Income under AMT, where applicable','3',989330,False), (5,'Net Tax Payable','4',98793,True), (6,'Interest and Fee Payable','5',0,False), (7,'Total Tax, Interest and Fee Payable','6',98793,True), (8,'Taxes Paid','7',108288,True), (9,'Tax Payable / (-) Refundable [Row 6 - Row 7]','8',-9500,True), (10,'Accreted Income as per Section 115TD','9',0,False), (11,'Additional Tax Payable u/s 115TD','10',0,False), (12,'Interest Payable u/s 115TE','11',0,False), (13,'Additional Tax and Interest Payable','12',0,False), (14,'Tax and Interest Paid','13',0,False), (15,'Tax Payable / (-) Refundable [Row 12 - Row 13]','14',0,False), ] for sl,desc,sched,amt,bold in tax_rows: if sl == 9: fl = grn_fill elif sl in [2,5,7,8]: fl = blu_fill elif sl % 2 == 0: fl = alt_fill else: fl = wht_fill fnt = Font(name='Arial',bold=True,size=10) if bold else Font(name='Arial',size=10) sc(r,1,sl,fnt,fl,ctr,tb) sc(r,2,desc,fnt,fl,lft,tb) sc(r,3,sched,fnt,fl,ctr,tb) amt_cell = sc(r,4,amt,fnt,fl,rgt,tb,'#,##0;(#,##0);\"-\"') if sl == 9: amt_cell.font = Font(name='Arial',bold=True,color='006400',size=10) ws.row_dimensions[r].height = 17 r += 1 # Note r += 1 ws.merge_cells(f'A{r}:D{r}') sc(r,1,'NOTE: This is a computer-generated acknowledgement. DO NOT send this to CPC, Bengaluru.', Font(name='Arial',italic=True,size=9,color='7F7F7F'),yel_fill,lft) ws.row_dimensions[r].height = 16 r += 1 ws.merge_cells(f'A{r}:D{r}') sc(r,1,'Barcode/QR Data: CAWPA4355E025277870300609251e280f191779282ced2fab45f3d87369b51c711c', Font(name='Arial',italic=True,size=9,color='7F7F7F'),wht_fill,lft) ws.row_dimensions[r].height = 16 ws.column_dimensions['A'].width = 8 ws.column_dimensions['B'].width = 52 ws.column_dimensions['C'].width = 14 ws.column_dimensions['D'].width = 18 ws.freeze_panes = 'A5' out = '/home/daytona/workspace/itr-excel/DIVYAM_ARUNKUMAR_AGRAWAL_ITR_AY2025-26.xlsx' wb.save(out) print('Saved:', out) "

Running Command

python3 -c " import xlsxwriter, os out = '/home/daytona/workspace/itr-excel/DIVYAM_ARUNKUMAR_AGRAWAL_ITR_AY2025-26.xlsx' os.makedirs('/home/daytona/workspace/itr-excel', exist_ok=True) wb = xlsxwriter.Workbook(out) ws = wb.add_worksheet('ITR Acknowledgement') # Formats title_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':13,'font_color':'FFFFFF','bg_color':'1F4E79','align':'center','valign':'vcenter','border':0}) sub_title_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':11,'font_color':'FFFFFF','bg_color':'1F4E79','align':'center','valign':'vcenter'}) section_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':11,'font_color':'1F4E79','bg_color':'BDD7EE','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1}) lbl_alt_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':10,'bg_color':'EBF3FB','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}) lbl_wht_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':10,'bg_color':'FFFFFF','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}) val_alt_fmt = wb.add_format({'font_name':'Arial','font_size':10,'bg_color':'EBF3FB','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}) val_wht_fmt = wb.add_format({'font_name':'Arial','font_size':10,'bg_color':'FFFFFF','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}) col_hdr_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':10,'font_color':'FFFFFF','bg_color':'2E75B6','align':'center','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}) # Tax row formats def tax_fmt(bg, bold=False, color='000000', align='left', num=False): fmt = {'font_name':'Arial','font_size':10,'font_color':color,'bg_color':bg, 'align':align,'valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True} if bold: fmt['bold'] = True if num: fmt['num_format'] = '#,##0;(#,##0);"-"' return wb.add_format(fmt) wht = 'FFFFFF'; alt = 'EBF3FB'; blu = 'DDEBF7'; grn = 'E2EFDA' # Column widths ws.set_column('A:A', 8) ws.set_column('B:B', 52) ws.set_column('C:C', 14) ws.set_column('D:D', 18) # Row 0: Title ws.set_row(0, 28) ws.merge_range('A1:D1', 'INDIAN INCOME TAX RETURN ACKNOWLEDGEMENT', title_fmt) ws.set_row(1, 20) ws.merge_range('A2:D2', 'Assessment Year: 2025-26 | Form Number: ITR-2', sub_title_fmt) # Ack Details r = 3 # 0-indexed ws.set_row(r, 20) ws.merge_range(r, 0, r, 3, 'ACKNOWLEDGEMENT DETAILS', section_fmt) r += 1 ack = [ ('Acknowledgement Number','527787030060925'), ('Date of Filing','06-Sep-2025'), ('ITR Transmitted On','06-Sep-2025 15:13:00'), ('Verified On','09-Sep-2025'), ('Transmission IP Address','117.223.195.40'), ('Verification Method','Electronic Verification Code (EVC) via Aadhaar OTP'), ('EVC Code','EBB1FE7121'), ] for i,(lbl,val) in enumerate(ack): ws.set_row(r, 17) lf = lbl_alt_fmt if i%2==0 else lbl_wht_fmt vf = val_alt_fmt if i%2==0 else val_wht_fmt ws.write(r, 0, lbl, lf) ws.merge_range(r, 1, r, 3, val, vf) r += 1 r += 1 # blank row ws.set_row(r, 20) ws.merge_range(r, 0, r, 3, 'TAXPAYER DETAILS', section_fmt) r += 1 tp = [ ('PAN','CAWPA4355E'), ('Full Name','DIVYAM ARUNKUMAR AGRAWAL'), ('Address','06 ARUNODAY, AMRAPALI SOCIETY, DAHOD, Dahod, Gujarat - 389151, India'), ('Taxpayer Status','Individual'), ('Form Number','ITR-2'), ('Filed Under Section','139(1) - On or before due date'), ] for i,(lbl,val) in enumerate(tp): ws.set_row(r, 17) lf = lbl_alt_fmt if i%2==0 else lbl_wht_fmt vf = val_alt_fmt if i%2==0 else val_wht_fmt ws.write(r, 0, lbl, lf) ws.merge_range(r, 1, r, 3, val, vf) r += 1 r += 1 ws.set_row(r, 20) ws.merge_range(r, 0, r, 3, 'TAX COMPUTATION SUMMARY (Amount in INR)', section_fmt) r += 1 ws.set_row(r, 18) for c,h in enumerate(['Sl. No.','Description','Schedule Ref.','Amount (INR)']): ws.write(r, c, h, col_hdr_fmt) r += 1 tax_rows = [ (1,'Current Year Business Loss, if any','1',0,False,wht), (2,'Total Income','1A',989330,True,blu), (3,'Book Profit under MAT, where applicable','2',0,False,alt), (4,'Adjusted Total Income under AMT, where applicable','3',989330,False,wht), (5,'Net Tax Payable','4',98793,True,blu), (6,'Interest and Fee Payable','5',0,False,alt), (7,'Total Tax, Interest and Fee Payable','6',98793,True,blu), (8,'Taxes Paid','7',108288,True,blu), (9,'Tax Payable / (-) Refundable [Row 6 - Row 7]','8',-9500,True,grn), (10,'Accreted Income as per Section 115TD','9',0,False,wht), (11,'Additional Tax Payable u/s 115TD','10',0,False,alt), (12,'Interest Payable u/s 115TE','11',0,False,wht), (13,'Additional Tax and Interest Payable','12',0,False,alt), (14,'Tax and Interest Paid','13',0,False,wht), (15,'Tax Payable / (-) Refundable [Row 12 - Row 13]','14',0,False,alt), ] for sl,desc,sched,amt,bold,bg in tax_rows: ws.set_row(r, 17) col = '006400' if sl==9 else '000000' sf = tax_fmt(bg, bold, col, 'center') df = tax_fmt(bg, bold, col, 'left') af = tax_fmt(bg, bold, col, 'right', num=True) ws.write(r, 0, sl, sf) ws.write(r, 1, desc, df) ws.write(r, 2, sched, sf) ws.write(r, 3, amt, af) r += 1 r += 1 note_fmt = wb.add_format({'italic':True,'font_name':'Arial','font_size':9,'font_color':'7F7F7F','bg_color':'FFF2CC','align':'left','valign':'vcenter','text_wrap':True}) ws.set_row(r, 16) ws.merge_range(r, 0, r, 3, 'NOTE: This is a computer-generated acknowledgement. DO NOT send this to CPC, Bengaluru.', note_fmt) r += 1 qr_fmt = wb.add_format({'italic':True,'font_name':'Arial','font_size':9,'font_color':'7F7F7F','bg_color':'FFFFFF','align':'left','valign':'vcenter','text_wrap':True}) ws.set_row(r, 16) ws.merge_range(r, 0, r, 3, 'Barcode/QR Data: CAWPA4355E025277870300609251e280f191779282ced2fab45f3d87369b51c711c', qr_fmt) wb.close() print('Done:', out) "

Running Command

pip install xlsxwriter --user -q && python3 -c "import xlsxwriter; print('OK', xlsxwriter.__version__)"

Writing File

~/itr-excel/make_itr.py

import xlsxwriter, os

out = '/home/daytona/workspace/itr-excel/DIVYAM_ARUNKUMAR_AGRAWAL_ITR_AY2025-26.xlsx'
os.makedirs('/home/daytona/workspace/itr-excel', exist_ok=True)

wb = xlsxwriter.Workbook(out)
ws = wb.add_worksheet('ITR Acknowledgement')

# Formats
title_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':13,'font_color':'FFFFFF','bg_color':'1F4E79','align':'center','valign':'vcenter','border':0})
sub_title_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':11,'font_color':'FFFFFF','bg_color':'1F4E79','align':'center','valign':'vcenter'})
section_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':11,'font_color':'1F4E79','bg_color':'BDD7EE','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1})
lbl_alt_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':10,'bg_color':'EBF3FB','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True})
lbl_wht_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':10,'bg_color':'FFFFFF','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True})
val_alt_fmt = wb.add_format({'font_name':'Arial','font_size':10,'bg_color':'EBF3FB','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True})
val_wht_fmt = wb.add_format({'font_name':'Arial','font_size':10,'bg_color':'FFFFFF','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True})
col_hdr_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':10,'font_color':'FFFFFF','bg_color':'2E75B6','align':'center','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True})

wht = 'FFFFFF'; alt = 'EBF3FB'; blu = 'DDEBF7'; grn = 'E2EFDA'

def tax_fmt(bg, bold=False, color='000000', align='left', num=False):
    fmt = {'font_name':'Arial','font_size':10,'font_color':color,'bg_color':bg,
           'align':align,'valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}
    if bold: fmt['bold'] = True
    if num: fmt['num_format'] = '#,##0;(#,##0);"-"'
    return wb.add_format(fmt)

# Column widths
ws.set_column('A:A', 8)
ws.set_column('B:B', 52)
ws.set_column('C:C', 14)
ws.set_column('D:D', 18)

# Row 0-1: Titles
ws.set_row(0, 28)
ws.merge_range('A1:D1', 'INDIAN INCOME TAX RETURN ACKNOWLEDGEMENT', title_fmt)
ws.set_row(1, 20)
ws.merge_range('A2:D2', 'Assessment Year: 2025-26  |  Form Number: ITR-2', sub_title_fmt)

# Ack Details (row index 3)
r = 3
ws.set_row(r, 20)
ws.merge_range(r, 0, r, 3, 'ACKNOWLEDGEMENT DETAILS', section_fmt)
r += 1

ack = [
    ('Acknowledgement Number', '527787030060925'),
    ('Date of Filing', '06-Sep-2025'),
    ('ITR Transmitted On', '06-Sep-2025  15:13:00'),
    ('Verified On', '09-Sep-2025'),
    ('Transmission IP Address', '117.223.195.40'),
    ('Verification Method', 'Electronic Verification Code (EVC) via Aadhaar OTP'),
    ('EVC Code', 'EBB1FE7121'),
]
for i, (lbl, val) in enumerate(ack):
    ws.set_row(r, 17)
    lf = lbl_alt_fmt if i % 2 == 0 else lbl_wht_fmt
    vf = val_alt_fmt if i % 2 == 0 else val_wht_fmt
    ws.write(r, 0, lbl, lf)
    ws.merge_range(r, 1, r, 3, val, vf)
    r += 1

r += 1
ws.set_row(r, 20)
ws.merge_range(r, 0, r, 3, 'TAXPAYER DETAILS', section_fmt)
r += 1

tp = [
    ('PAN', 'CAWPA4355E'),
    ('Full Name', 'DIVYAM ARUNKUMAR AGRAWAL'),
    ('Address', '06 ARUNODAY, AMRAPALI SOCIETY, DAHOD, Dahod, Gujarat - 389151, India'),
    ('Taxpayer Status', 'Individual'),
    ('Form Number', 'ITR-2'),
    ('Filed Under Section', '139(1) - On or before due date'),
]
for i, (lbl, val) in enumerate(tp):
    ws.set_row(r, 17)
    lf = lbl_alt_fmt if i % 2 == 0 else lbl_wht_fmt
    vf = val_alt_fmt if i % 2 == 0 else val_wht_fmt
    ws.write(r, 0, lbl, lf)
    ws.merge_range(r, 1, r, 3, val, vf)
    r += 1

r += 1
ws.set_row(r, 20)
ws.merge_range(r, 0, r, 3, 'TAX COMPUTATION SUMMARY (Amount in INR)', section_fmt)
r += 1
ws.set_row(r, 18)
for c, h in enumerate(['Sl. No.', 'Description', 'Schedule Ref.', 'Amount (INR)']):
    ws.write(r, c, h, col_hdr_fmt)
r += 1

tax_rows = [
    (1,  'Current Year Business Loss, if any',                         '1',   0,       False, wht),
    (2,  'Total Income',                                                '1A',  989330,  True,  blu),
    (3,  'Book Profit under MAT, where applicable',                    '2',   0,       False, alt),
    (4,  'Adjusted Total Income under AMT, where applicable',          '3',   989330,  False, wht),
    (5,  'Net Tax Payable',                                             '4',   98793,   True,  blu),
    (6,  'Interest and Fee Payable',                                    '5',   0,       False, alt),
    (7,  'Total Tax, Interest and Fee Payable',                        '6',   98793,   True,  blu),
    (8,  'Taxes Paid',                                                  '7',   108288,  True,  blu),
    (9,  'Tax Payable / (-) Refundable  [Row 6 - Row 7]',             '8',   -9500,   True,  grn),
    (10, 'Accreted Income as per Section 115TD',                       '9',   0,       False, wht),
    (11, 'Additional Tax Payable u/s 115TD',                           '10',  0,       False, alt),
    (12, 'Interest Payable u/s 115TE',                                 '11',  0,       False, wht),
    (13, 'Additional Tax and Interest Payable',                        '12',  0,       False, alt),
    (14, 'Tax and Interest Paid',                                      '13',  0,       False, wht),
    (15, 'Tax Payable / (-) Refundable  [Row 12 - Row 13]',           '14',  0,       False, alt),
]

for sl, desc, sched, amt, bold, bg in tax_rows:
    ws.set_row(r, 17)
    col = '006400' if sl == 9 else '000000'
    sf = tax_fmt(bg, bold, col, 'center')
    df = tax_fmt(bg, bold, col, 'left')
    af = tax_fmt(bg, bold, col, 'right', num=True)
    ws.write(r, 0, sl, sf)
    ws.write(r, 1, desc, df)
    ws.write(r, 2, sched, sf)
    ws.write(r, 3, amt, af)
    r += 1

r += 1
note_fmt = wb.add_format({'italic':True,'font_name':'Arial','font_size':9,'font_color':'7F7F7F','bg_color':'FFF2CC','align':'left','valign':'vcenter','text_wrap':True})
ws.set_row(r, 16)
ws.merge_range(r, 0, r, 3, 'NOTE: Computer-generated acknowledgement. DO NOT send this to CPC, Bengaluru.', note_fmt)
r += 1
qr_fmt = wb.add_format({'italic':True,'font_name':'Arial','font_size':9,'font_color':'7F7F7F','bg_color':'FFFFFF','align':'left','valign':'vcenter','text_wrap':True})
ws.set_row(r, 16)
ws.merge_range(r, 0, r, 3, 'Barcode/QR Data: CAWPA4355E025277870300609251e280f191779282ced2fab45f3d87369b51c711c', qr_fmt)

wb.close()
print('Saved:', out)
Running Command

cd /home/daytona/workspace/itr-excel && python3 make_itr.py && ls -lh *.xlsx

Running Command

df -h && python3 -c " import xlsxwriter, shutil tmp_out = '/tmp/itr_temp.xlsx' final_out = '/home/daytona/workspace/itr-excel/DIVYAM_ARUNKUMAR_AGRAWAL_ITR_AY2025-26.xlsx' wb = xlsxwriter.Workbook(tmp_out) ws = wb.add_worksheet('ITR Acknowledgement') title_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':13,'font_color':'FFFFFF','bg_color':'1F4E79','align':'center','valign':'vcenter'}) sub_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':11,'font_color':'FFFFFF','bg_color':'1F4E79','align':'center','valign':'vcenter'}) sec_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':11,'font_color':'1F4E79','bg_color':'BDD7EE','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1}) la_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':10,'bg_color':'EBF3FB','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}) lw_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':10,'bg_color':'FFFFFF','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}) va_fmt = wb.add_format({'font_name':'Arial','font_size':10,'bg_color':'EBF3FB','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}) vw_fmt = wb.add_format({'font_name':'Arial','font_size':10,'bg_color':'FFFFFF','align':'left','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True}) ch_fmt = wb.add_format({'bold':True,'font_name':'Arial','font_size':10,'font_color':'FFFFFF','bg_color':'2E75B6','align':'center','valign':'vcenter','left':1,'right':1,'top':1,'bottom':1}) def tf(bg,bold=False,color='000000',align='left',num=False): f={'font_name':'Arial','font_size':10,'font_color':color,'bg_color':bg,'align':align,'valign':'vcenter','left':1,'right':1,'top':1,'bottom':1,'text_wrap':True} if bold: f['bold']=True if num: f['num_format']='#,##0;(#,##0);\"-\"' return wb.add_format(f) ws.set_column('A:A',8); ws.set_column('B:B',52); ws.set_column('C:C',14); ws.set_column('D:D',18) ws.set_row(0,28); ws.merge_range('A1:D1','INDIAN INCOME TAX RETURN ACKNOWLEDGEMENT',title_fmt) ws.set_row(1,20); ws.merge_range('A2:D2','Assessment Year: 2025-26 | Form Number: ITR-2',sub_fmt) r=3 ws.set_row(r,20); ws.merge_range(r,0,r,3,'ACKNOWLEDGEMENT DETAILS',sec_fmt); r+=1 for i,(l,v) in enumerate([('Acknowledgement Number','527787030060925'),('Date of Filing','06-Sep-2025'),('ITR Transmitted On','06-Sep-2025 15:13:00'),('Verified On','09-Sep-2025'),('IP Address','117.223.195.40'),('Verification Method','EVC via Aadhaar OTP'),('EVC Code','EBB1FE7121')]): ws.set_row(r,17); ws.write(r,0,l,la_fmt if i%2==0 else lw_fmt); ws.merge_range(r,1,r,3,v,va_fmt if i%2==0 else vw_fmt); r+=1 r+=1 ws.set_row(r,20); ws.merge_range(r,0,r,3,'TAXPAYER DETAILS',sec_fmt); r+=1 for i,(l,v) in enumerate([('PAN','CAWPA4355E'),('Full Name','DIVYAM ARUNKUMAR AGRAWAL'),('Address','06 ARUNODAY, AMRAPALI SOCIETY, DAHOD, Dahod, Gujarat - 389151, India'),('Taxpayer Status','Individual'),('Form Number','ITR-2'),('Filed Under Section','139(1) - On or before due date')]): ws.set_row(r,17); ws.write(r,0,l,la_fmt if i%2==0 else lw_fmt); ws.merge_range(r,1,r,3,v,va_fmt if i%2==0 else vw_fmt); r+=1 r+=1 ws.set_row(r,20); ws.merge_range(r,0,r,3,'TAX COMPUTATION SUMMARY (Amount in INR)',sec_fmt); r+=1 ws.set_row(r,18) for c,h in enumerate(['Sl. No.','Description','Schedule Ref.','Amount (INR)']): ws.write(r,c,h,ch_fmt) r+=1 W='FFFFFF';A='EBF3FB';B='DDEBF7';G='E2EFDA' rows=[(1,'Current Year Business Loss, if any','1',0,False,W),(2,'Total Income','1A',989330,True,B),(3,'Book Profit under MAT, where applicable','2',0,False,A),(4,'Adjusted Total Income under AMT, where applicable','3',989330,False,W),(5,'Net Tax Payable','4',98793,True,B),(6,'Interest and Fee Payable','5',0,False,A),(7,'Total Tax, Interest and Fee Payable','6',98793,True,B),(8,'Taxes Paid','7',108288,True,B),(9,'Tax Payable / (-) Refundable [Row 6 - Row 7]','8',-9500,True,G),(10,'Accreted Income as per Section 115TD','9',0,False,W),(11,'Additional Tax Payable u/s 115TD','10',0,False,A),(12,'Interest Payable u/s 115TE','11',0,False,W),(13,'Additional Tax and Interest Payable','12',0,False,A),(14,'Tax and Interest Paid','13',0,False,W),(15,'Tax Payable / (-) Refundable [Row 12-Row 13]','14',0,False,A)] for sl,desc,sched,amt,bold,bg in rows: ws.set_row(r,17); col='006400' if sl==9 else '000000' ws.write(r,0,sl,tf(bg,bold,col,'center')); ws.write(r,1,desc,tf(bg,bold,col,'left')); ws.write(r,2,sched,tf(bg,bold,col,'center')); ws.write(r,3,amt,tf(bg,bold,col,'right',num=True)); r+=1 r+=1 ws.set_row(r,16); ws.merge_range(r,0,r,3,'NOTE: Computer-generated acknowledgement. DO NOT send to CPC, Bengaluru.',wb.add_format({'italic':True,'font_name':'Arial','font_size':9,'font_color':'7F7F7F','bg_color':'FFF2CC','align':'left','valign':'vcenter','text_wrap':True})); r+=1 ws.set_row(r,16); ws.merge_range(r,0,r,3,'QR/Barcode: CAWPA4355E025277870300609251e280f191779282ced2fab45f3d87369b51c711c',wb.add_format({'italic':True,'font_name':'Arial','font_size':9,'font_color':'7F7F7F','bg_color':'FFFFFF','align':'left','valign':'vcenter','text_wrap':True})) wb.close() shutil.copy(tmp_out, final_out) print('Done:', final_out) import os; print('Size:', os.path.getsize(final_out), 'bytes') "

Running Command

ls -la /tmp/itr_temp.xlsx && cp /tmp/itr_temp.xlsx /home/daytona/workspace/itr-excel/DIVYAM_ARUNKUMAR_AGRAWAL_ITR_AY2025-26.xlsx 2>&1 || true # Try alternative copy without metadata python3 -c " with open('/tmp/itr_temp.xlsx','rb') as f: data = f.read() with open('/home/daytona/workspace/itr-excel/DIVYAM_ARUNKUMAR_AGRAWAL_ITR_AY2025-26.xlsx','wb') as f: f.write(data) import os print('Written:', os.path.getsize('/home/daytona/workspace/itr-excel/DIVYAM_ARUNKUMAR_AGRAWAL_ITR_AY2025-26.xlsx'), 'bytes') "

The file is ready. Here's your Excel file:

DIVYAM ARUNKUMAR AGRAWAL ITR AY2025 26

Spreadsheet · XLSX

Here's what was included in the Excel file, organized across three sections:
Acknowledgement Details
  • Acknowledgement number, filing date, transmission timestamp, verification date, IP address, EVC code, and verification method
Taxpayer Details
  • PAN (CAWPA4355E), full name, address, status (Individual), form number (ITR-2), and filing section
Tax Computation Summary All 15 schedule rows including:
  • Total Income: ₹9,89,330
  • Net Tax Payable: ₹98,793
  • Taxes Paid: ₹1,08,288
  • Refund: ₹9,500 (highlighted in green)
The sheet uses color-coding: blue rows for key figures, green for the refund row, and alternating shading for easy reading.
This is a shared conversation. Sign in to Orris to start your own chat.