~/neet-pg/create_study_plan.py
from docx import Document
from docx.shared import Pt, Inches, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml.ns import qn
from docx.oxml import OxmlElement
doc = Document()
# Page margins
from docx.shared import Inches
section = doc.sections[0]
section.top_margin = Inches(0.8)
section.bottom_margin = Inches(0.8)
section.left_margin = Inches(1.0)
section.right_margin = Inches(1.0)
# Default style
style = doc.styles["Normal"]
style.font.name = "Arial"
style.font.size = Pt(11)
# ─── Helper: shade a table row ───────────────────────────────────────────────
def shade_cell(cell, hex_color):
tc = cell._tc
tcPr = tc.get_or_add_tcPr()
shd = OxmlElement('w:shd')
shd.set(qn('w:val'), 'clear')
shd.set(qn('w:color'), 'auto')
shd.set(qn('w:fill'), hex_color)
tcPr.append(shd)
def set_cell_font(cell, bold=False, size=10, color=None, center=False):
for para in cell.paragraphs:
if center:
para.alignment = WD_ALIGN_PARAGRAPH.CENTER
for run in para.runs:
run.font.bold = bold
run.font.size = Pt(size)
run.font.name = "Arial"
if color:
run.font.color.rgb = RGBColor.from_string(color)
def add_cell_text(cell, text, bold=False, size=10, color=None, center=False):
cell.text = text
set_cell_font(cell, bold=bold, size=size, color=color, center=center)
# ─── TITLE ───────────────────────────────────────────────────────────────────
title = doc.add_heading("NEET PG 2026 – 46-Day High-Yield Study Plan", level=1)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
title_run = title.runs[0]
title_run.font.color.rgb = RGBColor(0x1A, 0x4E, 0x7C)
title_run.font.size = Pt(16)
# Subtitle
sub = doc.add_paragraph("Target: 400+ Marks | Exam Date: August 30, 2026 | Start Date: July 15, 2026")
sub.alignment = WD_ALIGN_PARAGRAPH.CENTER
for run in sub.runs:
run.font.size = Pt(11)
run.font.bold = True
run.font.color.rgb = RGBColor(0x8B, 0x00, 0x00)
doc.add_paragraph("")
# ─── STRATEGY BOX ────────────────────────────────────────────────────────────
strat = doc.add_paragraph()
strat_run = strat.add_run("📌 Strategy: 1–2 topics per day + evening revision of previous day. "
"Solve NEET PG PYQs (2018–2025) daily — covers ~60% of exam content.")
strat_run.font.size = Pt(10)
strat_run.font.italic = True
strat_run.font.color.rgb = RGBColor(0x2E, 0x6B, 0x2E)
doc.add_paragraph("")
# ─── WEEK DATA ───────────────────────────────────────────────────────────────
weeks = [
{
"title": "WEEK 1 (July 15–21) – Medicine & Pharmacology",
"color": "D6E4F0",
"header_color": "1A4E7C",
"rows": [
("1", "Jul 15", "Medicine", "Diabetes – diagnosis, insulin types, oral hypoglycemics, complications"),
("2", "Jul 16", "Medicine", "Hypertension – JNC guidelines, drug classes, hypertensive emergencies"),
("3", "Jul 17", "Medicine", "Heart Failure – types, pathophysiology, drug management (RAAS, diuretics)"),
("4", "Jul 18", "Pharmacology", "Autonomic drugs – adrenergic, cholinergic agonists & antagonists"),
("5", "Jul 19", "Pharmacology", "Antihypertensives, diuretics, antiarrhythmics"),
("6", "Jul 20", "Pharmacology", "Antibiotics – mechanisms, resistance, drug of choice for infections"),
("7", "Jul 21", "REVISION DAY", "Revise all of Week 1 – solve MCQs"),
]
},
{
"title": "WEEK 2 (July 22–28) – Surgery & Anatomy",
"color": "D5F0E4",
"header_color": "1A6B3C",
"rows": [
("8", "Jul 22", "Surgery", "Thyroid – goiter, carcinoma, investigations, surgery"),
("9", "Jul 23", "Surgery", "Breast cancer – staging, lymph nodes, treatment"),
("10", "Jul 24", "Surgery", "GI surgery – appendix, intestinal obstruction, hernia"),
("11", "Jul 25", "Anatomy", "Brachial plexus – roots, trunks, cords, nerve injuries"),
("12", "Jul 26", "Anatomy", "Head & Neck – cranial nerves, triangles of neck, sinuses"),
("13", "Jul 27", "Anatomy", "Lower limb nerves, perineum, clinical anatomy spots"),
("14", "Jul 28", "REVISION DAY", "Revise Week 2 + MCQs"),
]
},
{
"title": "WEEK 3 (July 29 – August 4) – Pathology & Microbiology",
"color": "F0EAD6",
"header_color": "7C4E1A",
"rows": [
("15", "Jul 29", "Pathology", "Neoplasia – oncogenes, tumor markers, carcinogenesis"),
("16", "Jul 30", "Pathology", "Blood disorders – anemias (iron def, B12, hemolytic), leukemias"),
("17", "Jul 31", "Pathology", "Inflammation, wound healing, cell injury & necrosis"),
("18", "Aug 1", "Microbiology", "Bacteria – gram stain, culture media, exotoxins/endotoxins"),
("19", "Aug 2", "Microbiology", "Viruses – hepatitis, herpes, HIV, dengue"),
("20", "Aug 3", "Microbiology", "Parasitology – malaria, kala azar, filaria, tapeworms"),
("21", "Aug 4", "REVISION DAY", "Revise Week 3 + MCQs"),
]
},
{
"title": "WEEK 4 (August 5–11) – OBG & Pediatrics",
"color": "F0D6E4",
"header_color": "7C1A4E",
"rows": [
("22", "Aug 5", "OBG", "Normal labor – stages, partogram, mechanism of labor"),
("23", "Aug 6", "OBG", "High-risk pregnancy – PIH, PPH, APH, placenta previa"),
("24", "Aug 7", "OBG", "Gynecology – PCOD, endometriosis, fibroid, contraception"),
("25", "Aug 8", "Pediatrics", "Neonatal topics – Apgar, birth asphyxia, jaundice, NEC"),
("26", "Aug 9", "Pediatrics", "Developmental milestones, vaccines (NIS), growth charts"),
("27", "Aug 10", "Pediatrics", "Pediatric emergencies – febrile seizures, intussusception, croup"),
("28", "Aug 11", "REVISION DAY", "Revise Week 4 + MCQs"),
]
},
{
"title": "WEEK 5 (August 12–18) – PSM, Biochemistry & Physiology",
"color": "E4D6F0",
"header_color": "4E1A7C",
"rows": [
("29", "Aug 12", "PSM", "Epidemiology – study designs, bias, screening tests, sensitivity/specificity"),
("30", "Aug 13", "PSM", "National health programs – TB (NTEP), malaria, leprosy, RMNCH"),
("31", "Aug 14", "PSM", "Nutrition, vaccines, vital statistics, Bhore committee"),
("32", "Aug 15", "Biochemistry", "Enzymes, vitamins, minerals – deficiencies & clinical features"),
("33", "Aug 16", "Biochemistry", "Metabolism – glycolysis, TCA cycle, HMP shunt, fatty acids"),
("34", "Aug 17", "Physiology", "Cardiac physiology – action potential, ECG, cardiac cycle"),
("35", "Aug 18", "REVISION DAY", "Revise Week 5 + MCQs"),
]
},
{
"title": "WEEK 6 (August 19–25) – ENT, Ophthalmology & Dermatology",
"color": "D6F0EE",
"header_color": "1A7C6B",
"rows": [
("36", "Aug 19", "ENT", "Ear – otitis media, CSOM, cholesteatoma, hearing tests"),
("37", "Aug 20", "ENT", "Nose & throat – epistaxis, sinusitis, tonsillitis, voice disorders"),
("38", "Aug 21", "Ophthalmology", "Glaucoma, cataract, retinal detachment, diabetic retinopathy"),
("39", "Aug 22", "Ophthalmology", "Cornea, uveitis, squint, refraction errors"),
("40", "Aug 23", "Dermatology", "Leprosy, psoriasis, pemphigus, SLE skin findings"),
("41", "Aug 24", "Dermatology", "Skin infections – fungal, STIs, vitiligo, drug reactions"),
("42", "Aug 25", "REVISION DAY", "Revise Week 6 + MCQs"),
]
},
{
"title": "FINAL STRETCH (August 26–29) – Rapid Revision",
"color": "FFF3CD",
"header_color": "856404",
"rows": [
("43", "Aug 26", "Rapid Revision", "Medicine + Pharmacology high-yield one-liners & mnemonics"),
("44", "Aug 27", "Rapid Revision", "Surgery + Pathology + Microbiology one-liners"),
("45", "Aug 28", "Rapid Revision", "OBG + Pediatrics + PSM one-liners"),
("46", "Aug 29", "EXAM EVE", "Light revision only – mnemonics, relax, sleep early by 10 PM"),
]
},
]
COL_WIDTHS = [Inches(0.45), Inches(0.75), Inches(1.3), Inches(4.0)]
for week in weeks:
# Week heading
wh = doc.add_heading(week["title"], level=2)
wh.alignment = WD_ALIGN_PARAGRAPH.LEFT
wh_run = wh.runs[0]
r, g, b = (int(week["header_color"][i:i+2], 16) for i in (0, 2, 4))
wh_run.font.color.rgb = RGBColor(r, g, b)
wh_run.font.size = Pt(12)
# Table
tbl = doc.add_table(rows=1, cols=4)
tbl.style = "Table Grid"
# Header row
hdr_cells = tbl.rows[0].cells
for cell in hdr_cells:
shade_cell(cell, week["header_color"])
headers = ["Day", "Date", "Subject", "Topic"]
for i, h in enumerate(headers):
add_cell_text(hdr_cells[i], h, bold=True, size=10, color="FFFFFF", center=True)
# Set column widths on header
for i, w in enumerate(COL_WIDTHS):
hdr_cells[i].width = w
# Data rows
for idx, (day, date, subj, topic) in enumerate(week["rows"]):
row_cells = tbl.add_row().cells
is_revision = "REVISION" in subj or "EXAM EVE" in subj or "Rapid Revision" in subj
fill = "FFE6CC" if is_revision else week["color"]
for cell in row_cells:
shade_cell(cell, fill)
add_cell_text(row_cells[0], day, bold=True, size=10, center=True)
add_cell_text(row_cells[1], date, bold=False, size=10, center=True)
add_cell_text(row_cells[2], subj, bold=True if is_revision else False, size=10)
add_cell_text(row_cells[3], topic, bold=False, size=10)
for i, w in enumerate(COL_WIDTHS):
row_cells[i].width = w
doc.add_paragraph("")
# ─── HIGH-YIELD SUBJECT BREAKDOWN ────────────────────────────────────────────
doc.add_heading("High-Yield Subject Weightage (400+ Strategy)", level=2)
hy_run = doc.paragraphs[-1].runs[0]
hy_run.font.color.rgb = RGBColor(0x8B, 0x00, 0x00)
hy_run.font.size = Pt(12)
hy_table = doc.add_table(rows=1, cols=3)
hy_table.style = "Table Grid"
hy_hdr = hy_table.rows[0].cells
for cell in hy_hdr:
shade_cell(cell, "1A4E7C")
for i, h in enumerate(["Subject", "Approx Questions", "Key Focus Areas"]):
add_cell_text(hy_hdr[i], h, bold=True, size=10, color="FFFFFF", center=True)
hy_data = [
("Medicine", "30–35 Qs", "Diabetes, HTN, Heart Failure, Thyroid, Nephrology"),
("Surgery", "20–25 Qs", "Thyroid, Breast, GI, Trauma, Hernias"),
("Pharmacology", "20–25 Qs", "Drug mechanisms, DOC, Toxicology"),
("PSM", "20 Qs", "Epidemiology, National Programs, Biostatistics"),
("OBG", "20 Qs", "Normal & High-risk Pregnancy, Gynecology"),
("Pathology", "20 Qs", "Tumor markers, Anemias, Inflammation"),
("Microbiology", "15–18 Qs", "Bacteria, Viruses, Parasites"),
("Pediatrics", "15–18 Qs", "Milestones, Vaccines, Neonatal"),
("Anatomy", "12–15 Qs", "Brachial plexus, Cranial nerves, Clinical spots"),
("Biochemistry", "10–12 Qs", "Vitamins, Enzymes, Metabolic pathways"),
("Physiology", "10–12 Qs", "Cardiac, Renal, Respiratory physiology"),
("ENT", "8–10 Qs", "CSOM, Epistaxis, Hearing tests"),
("Ophthalmology", "8–10 Qs", "Glaucoma, Cataract, Retinal disorders"),
("Dermatology", "6–8 Qs", "Leprosy, Psoriasis, Pemphigus"),
]
hy_col_widths = [Inches(1.5), Inches(1.5), Inches(3.5)]
for i, (subj, qs, focus) in enumerate(hy_data):
row = hy_table.add_row().cells
fill = "EAF4FF" if i % 2 == 0 else "FFFFFF"
for cell in row:
shade_cell(cell, fill)
add_cell_text(row[0], subj, bold=True, size=10)
add_cell_text(row[1], qs, bold=False, size=10, center=True)
add_cell_text(row[2], focus, bold=False, size=10)
for j, w in enumerate(hy_col_widths):
row[j].width = w
doc.add_paragraph("")
# ─── FOOTER NOTE ─────────────────────────────────────────────────────────────
footer_para = doc.add_paragraph()
footer_run = footer_para.add_run(
"Tip: Solve NEET PG Previous Year Questions (2018–2025) daily alongside topics. "
"That alone covers ~60% of what appears in the exam. "
"Good luck – You've got this! 💪"
)
footer_run.font.size = Pt(10)
footer_run.font.italic = True
footer_run.font.bold = True
footer_run.font.color.rgb = RGBColor(0x2E, 0x6B, 0x2E)
footer_para.alignment = WD_ALIGN_PARAGRAPH.CENTER
# ─── SAVE ────────────────────────────────────────────────────────────────────
out_path = "/tmp/workspace/neet-pg/NEET_PG_2026_Study_Plan.docx"
doc.save(out_path)
print(f"Saved: {out_path}")