Skip to content

Instantly share code, notes, and snippets.

@111mihir
Last active January 20, 2026 13:07
Show Gist options
  • Select an option

  • Save 111mihir/cc5d0c71c3a5077f4bab6e4839d2c397 to your computer and use it in GitHub Desktop.

Select an option

Save 111mihir/cc5d0c71c3a5077f4bab6e4839d2c397 to your computer and use it in GitHub Desktop.
Rent Receipt Generator (India)
"""
Rent Receipt Generator (Income Tax Dept. format – India)
Generates rent receipts in the exact format commonly accepted for:
- HRA claims
- Income Tax filings
- CA / scrutiny purposes
Features:
- Exact ITD wording & layout
- No watermark
- No revenue stamp
- One receipt per page
- Combined PDF output
Dependency:
pip install reportlab
"""
from reportlab.platypus import (
SimpleDocTemplate,
Paragraph,
Spacer,
PageBreak
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.pagesizes import A4
from reportlab.lib.enums import TA_CENTER, TA_LEFT
def generate_rent_receipts_pdf(
output_path: str,
tenant_name: str,
landlord_name: str,
landlord_pan: str,
rented_property_address: str,
landlord_address: str,
items: list[dict],
):
"""
Generate a combined PDF with one rent receipt per page.
Parameters:
----------
output_path : str
Output PDF file path
tenant_name : str
Name of the tenant
landlord_name : str
Name of the landlord
landlord_pan : str
PAN of the landlord (mandatory if annual rent > 1L)
rented_property_address : str
Full address of the rented house
landlord_address : str
Full postal address of the landlord
items : list of dict
Each item must contain:
{
"date": "01 Jul 2025",
"amount": "49,140/-",
"rent_period": "July 2025",
"monthly_rent": "50,000/-"
}
"""
# ----------------------------
# Styles (ITD-like)
# ----------------------------
styles = getSampleStyleSheet()
styles.add(ParagraphStyle(
name="TITLE",
alignment=TA_CENTER,
fontSize=16,
spaceAfter=6
))
styles.add(ParagraphStyle(
name="SUBTITLE",
alignment=TA_CENTER,
fontSize=10,
spaceAfter=24
))
styles.add(ParagraphStyle(
name="BODY",
alignment=TA_LEFT,
fontSize=11,
leading=18
))
# ----------------------------
# PDF setup
# ----------------------------
doc = SimpleDocTemplate(output_path, pagesize=A4)
elements = []
for idx, item in enumerate(items):
# Header
elements.append(
Paragraph("RECEIPT OF HOUSE RENT", styles["TITLE"])
)
elements.append(
Paragraph(
"(Under Section 10 (13A) of Income Tax Act)",
styles["SUBTITLE"]
)
)
# Body
elements.append(
Paragraph(
f"Received a sum of Rs. <b>{item['amount']}</b> from "
f"<b>{tenant_name}</b> towards<br/>"
f"rent at <b>{item['monthly_rent']}</b> per month for "
f"<b>{item['rent_period']}</b> in respect of the house situated at:",
styles["BODY"]
)
)
elements.append(Spacer(1, 10))
elements.append(
Paragraph(rented_property_address, styles["BODY"])
)
# Date
elements.append(Spacer(1, 30))
elements.append(
Paragraph(f"Date:&nbsp;{item['date']}", styles["BODY"])
)
# Signature section
elements.append(Spacer(1, 30))
elements.append(
Paragraph("Signature of the House Owner", styles["BODY"])
)
# Space for physical signature
elements.append(Spacer(1, 50))
# Owner details
elements.append(
Paragraph(landlord_name, styles["BODY"])
)
elements.append(Spacer(1, 10))
elements.append(
Paragraph(landlord_address, styles["BODY"])
)
elements.append(
Paragraph(f"PAN - {landlord_pan}", styles["BODY"])
)
if idx < len(items) - 1:
elements.append(PageBreak())
doc.build(elements)

Rent Receipt Generator (India)

Generate Income Tax Department–format rent receipts as a single PDF.

  • Exact Section 10(13A) receipt format
  • One receipt per page (multiple months supported)
  • No watermark, no revenue stamp
  • Suitable for HRA / ITR / CA use

Requirements

pip install reportlab

Usage Examples

from rent_receipt_generator import generate_rent_receipts_pdf

items = [
    {
        "date": "01 Jul 2025",
        "amount": "34,400/-",
        "rent_period": "July 2025",
        "monthly_rent": "50,000/-",
    },
    {
        "date": "01 Aug 2025",
        "amount": "49,140/-",
        "rent_period": "August 2025",
        "monthly_rent": "50,000/-",
    },
]

generate_rent_receipts_pdf(
    output_path="Rent_Receipts_FY_2025_26.pdf",
    tenant_name="Tenant Name",
    landlord_name="Landlord Name",
    landlord_pan="ABCDE1234F",
    rented_property_address="Full address of rented property",
    landlord_address="Full address of landlord",
    items=items,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment