Create a 3 days study plan for me everyday has 3 study slots Morning afternoon and evening. Organic chemistry exam is held on 3/06/2026 Organic Chemistry (Book) Here a chapter of organic chemistry 1.Basic Chemistry (imp) 2.Stereochemistry (imp) 3.General preparation (Alkane,Alkene, Alkyne) (Past papers) 4.Nucleophilic & electrophilic (Past papers) 5.Orientation benzene 6.Heterocyclic (imp) 7.Reaction Mechanism (Most imp & Difficult) 8.Intermediate & Free Radicals 9.Carbonium rearrangements 10.Carbanions rearrangements (most important) Note: I want to revise two times all the whole syllabus so kindly create a plan create from 31/05/2026 and I want that give more time and slots too important chapters for better preparation At the end create a pdf file

Reading File
Running Command

mkdir -p /home/daytona/workspace/study-plan && cat << 'PYEOF' > /home/daytona/workspace/study-plan/generate_plan.py from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import mm, cm from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether ) from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT from reportlab.platypus import PageBreak OUTPUT = "/home/daytona/workspace/study-plan/Organic_Chemistry_Study_Plan.pdf" doc = SimpleDocTemplate( OUTPUT, pagesize=A4, rightMargin=18*mm, leftMargin=18*mm, topMargin=18*mm, bottomMargin=18*mm ) # ── Colours ────────────────────────────────────────────────────────────────── C_DARK = colors.HexColor("#1A1A2E") C_BLUE = colors.HexColor("#16213E") C_ACCENT = colors.HexColor("#0F3460") C_GOLD = colors.HexColor("#E94560") C_LIGHT = colors.HexColor("#F5F5F5") C_WHITE = colors.white C_MORN = colors.HexColor("#FF6B6B") # morning – red-orange C_AFTN = colors.HexColor("#4ECDC4") # afternoon – teal C_EVEN = colors.HexColor("#45B7D1") # evening – sky blue C_IMP = colors.HexColor("#FFE66D") # important badge C_BORDER = colors.HexColor("#0F3460") # ── Styles ──────────────────────────────────────────────────────────────────── styles = getSampleStyleSheet() title_style = ParagraphStyle( "Title", parent=styles["Title"], fontSize=26, textColor=C_WHITE, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=4 ) subtitle_style = ParagraphStyle( "Sub", parent=styles["Normal"], fontSize=12, textColor=C_GOLD, alignment=TA_CENTER, fontName="Helvetica-BoldOblique", spaceAfter=2 ) date_style = ParagraphStyle( "Date", parent=styles["Normal"], fontSize=10, textColor=colors.HexColor("#AAAACC"), alignment=TA_CENTER, fontName="Helvetica", spaceAfter=0 ) day_header_style = ParagraphStyle( "DayH", parent=styles["Normal"], fontSize=16, textColor=C_WHITE, alignment=TA_CENTER, fontName="Helvetica-Bold" ) rev_badge_style = ParagraphStyle( "RevB", parent=styles["Normal"], fontSize=10, textColor=C_DARK, alignment=TA_CENTER, fontName="Helvetica-Bold" ) slot_title_style = ParagraphStyle( "SlotT", parent=styles["Normal"], fontSize=11, textColor=C_WHITE, alignment=TA_CENTER, fontName="Helvetica-Bold" ) slot_time_style = ParagraphStyle( "SlotTm", parent=styles["Normal"], fontSize=9, textColor=colors.HexColor("#DDDDDD"), alignment=TA_CENTER, fontName="Helvetica-Oblique" ) chapter_style = ParagraphStyle( "Chap", parent=styles["Normal"], fontSize=10, textColor=C_DARK, alignment=TA_LEFT, fontName="Helvetica", leading=14 ) note_style = ParagraphStyle( "Note", parent=styles["Normal"], fontSize=9, textColor=colors.HexColor("#555577"), alignment=TA_LEFT, fontName="Helvetica-Oblique", leading=13 ) legend_style = ParagraphStyle( "Leg", parent=styles["Normal"], fontSize=9, textColor=C_DARK, alignment=TA_LEFT, fontName="Helvetica" ) footer_style = ParagraphStyle( "Foot", parent=styles["Normal"], fontSize=8, textColor=colors.HexColor("#999999"), alignment=TA_CENTER, fontName="Helvetica-Oblique" ) tip_style = ParagraphStyle( "Tip", parent=styles["Normal"], fontSize=9, textColor=C_DARK, alignment=TA_LEFT, fontName="Helvetica", leading=13 ) # ── Chapter catalogue ───────────────────────────────────────────────────────── CHAPTERS = { 1: ("Basic Chemistry", "IMP"), 2: ("Stereochemistry", "IMP"), 3: ("General Preparation (Alkane/Alkene/Alkyne)", "PAST"), 4: ("Nucleophilic & Electrophilic", "PAST"), 5: ("Orientation of Benzene", ""), 6: ("Heterocyclic Compounds", "IMP"), 7: ("Reaction Mechanism", "MOST IMP"), 8: ("Intermediates & Free Radicals", ""), 9: ("Carbonium Rearrangements", ""), 10: ("Carbanion Rearrangements", "MOST IMP"), } def badge_color(tag): if tag == "MOST IMP": return colors.HexColor("#E94560") if tag == "IMP": return colors.HexColor("#FF9F43") if tag == "PAST": return colors.HexColor("#1DD1A1") return None def chapter_cell(nums): """Return a formatted string for a list of chapter numbers.""" lines = [] for n in nums: name, tag = CHAPTERS[n] bc = badge_color(tag) if bc: hex_bc = bc.hexval() if hasattr(bc,'hexval') else "#E94560" badge = f' <font color="{hex_bc}"><b>[{tag}]</b></font>' else: badge = "" lines.append(f"Ch {n}. {name}{badge}") return "<br/>".join(lines) def make_slot_table(slot_label, slot_time, chapters, slot_color, duration_note=""): """Build a single slot card as a Table.""" # header row header_content = [ Paragraph(slot_label, slot_title_style), Paragraph(slot_time, slot_time_style), ] if duration_note: header_content.append(Paragraph(duration_note, slot_time_style)) # chapter content chap_para = Paragraph(chapter_cell(chapters), chapter_style) data = [ [Paragraph(slot_label, slot_title_style)], [Paragraph(slot_time, slot_time_style)], [chap_para], ] t = Table(data, colWidths=[165*mm / 3 - 4]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (0,1), slot_color), ("BACKGROUND", (0,2), (-1,-1), C_LIGHT), ("BOX", (0,0), (-1,-1), 1.2, C_BORDER), ("LINEBELOW", (0,1), (0,1), 0.8, C_BORDER), ("TOPPADDING", (0,0), (-1,-1), 6), ("BOTTOMPADDING",(0,0), (-1,-1), 6), ("LEFTPADDING", (0,0), (-1,-1), 8), ("RIGHTPADDING",(0,0), (-1,-1), 8), ("VALIGN", (0,0), (-1,-1), "MIDDLE"), ])) return t # ── Schedule data ───────────────────────────────────────────────────────────── # Revision 1: Chapters 1-10 across Day1 (all 3 slots) + Day2 morning+afternoon # Revision 2: Day2 evening + Day3 all 3 slots # Important chapters get DOUBLE slots schedule = [ # ── DAY 1 – May 31 ────────────────────────────────────────────────────── { "day": "DAY 1 — Sunday, May 31, 2026", "rev": "REVISION 1 | Chapters 1 – 6", "rev_color": colors.HexColor("#FFD700"), "slots": [ { "label": "🌅 Morning", "time": "8:00 AM – 11:00 AM (3 hrs)", "chapters": [1, 2], "color": C_MORN, "note": "2 chapters · IMP", }, { "label": "☀️ Afternoon", "time": "1:00 PM – 4:00 PM (3 hrs)", "chapters": [3, 4], "color": C_AFTN, "note": "2 chapters · PAST PAPERS", }, { "label": "🌙 Evening", "time": "6:00 PM – 9:00 PM (3 hrs)", "chapters": [5, 6], "color": C_EVEN, "note": "2 chapters · Ch6 IMP", }, ], "tip": "Day 1 focus: Build your foundation. Read actively, write key reactions, and mark anything unclear for revisit.", }, # ── DAY 2 – June 1 ────────────────────────────────────────────────────── { "day": "DAY 2 — Monday, June 1, 2026", "rev": "REVISION 1 cont. | Ch 7–10 + REVISION 2 Start | Ch 1–3", "rev_color": colors.HexColor("#FFD700"), "slots": [ { "label": "🌅 Morning", "time": "7:00 AM – 12:00 PM (5 hrs)", "chapters": [7, 8], "color": C_MORN, "note": "MOST IMP – extended 5-hr block for Reaction Mechanism", }, { "label": "☀️ Afternoon", "time": "1:00 PM – 4:30 PM (3.5 hrs)", "chapters": [9, 10], "color": C_AFTN, "note": "Ch 10 MOST IMP – spend extra 30 min on Carbanion rearrangements", }, { "label": "🌙 Evening", "time": "6:00 PM – 9:30 PM (3.5 hrs)", "chapters": [1, 2, 3], "color": C_EVEN, "note": "REVISION 2 begins — quick but focused re-read of Ch 1–3", }, ], "tip": "Day 2 is the hardest day. Tackle Reaction Mechanism fresh in the morning when your brain is sharpest. Use flashcards for mechanisms.", }, # ── DAY 3 – June 2 ────────────────────────────────────────────────────── { "day": "DAY 3 — Tuesday, June 2, 2026", "rev": "REVISION 2 | Ch 4–10 + Final Review", "rev_color": colors.HexColor("#50C878"), "slots": [ { "label": "🌅 Morning", "time": "7:00 AM – 11:00 AM (4 hrs)", "chapters": [4, 5, 6], "color": C_MORN, "note": "Ch 4 PAST PAPERS · Ch 6 IMP – practice past paper Qs", }, { "label": "☀️ Afternoon", "time": "12:00 PM – 4:30 PM (4.5 hrs)", "chapters": [7, 8, 9], "color": C_AFTN, "note": "MOST IMP – re-do all mechanism problems, free radicals & carbonium", }, { "label": "🌙 Evening", "time": "6:00 PM – 9:00 PM (3 hrs)", "chapters": [10], "color": C_EVEN, "note": "MOST IMP – Carbanion Rearrangements deep dive + full syllabus quick recap", }, ], "tip": "Day 3 evening: After Ch 10, spend the last 30 min writing a one-page summary of every chapter from memory. This is your most powerful revision tool.", }, ] # ── Build flowable story ────────────────────────────────────────────────────── story = [] # ── COVER BANNER ── banner_data = [[ Paragraph("ORGANIC CHEMISTRY", title_style), ]] banner = Table(banner_data, colWidths=[165*mm]) banner.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), C_DARK), ("TOPPADDING", (0,0), (-1,-1), 18), ("BOTTOMPADDING",(0,0), (-1,-1), 6), ("LEFTPADDING", (0,0), (-1,-1), 10), ("RIGHTPADDING",(0,0), (-1,-1), 10), ("BOX", (0,0), (-1,-1), 2, C_GOLD), ])) story.append(banner) sub_data = [[Paragraph("3-Day Exam Study Plan · 2 Full Revisions", subtitle_style)]] sub_tbl = Table(sub_data, colWidths=[165*mm]) sub_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), C_ACCENT), ("TOPPADDING", (0,0), (-1,-1), 6), ("BOTTOMPADDING",(0,0), (-1,-1), 6), ])) story.append(sub_tbl) date_data = [[Paragraph("Study Period: May 31 – June 2, 2026 | Exam: June 3, 2026", date_style)]] date_tbl = Table(date_data, colWidths=[165*mm]) date_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), C_BLUE), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING",(0,0), (-1,-1), 8), ])) story.append(date_tbl) story.append(Spacer(1, 8*mm)) # ── LEGEND ── legend_items = [ (colors.HexColor("#E94560"), "[MOST IMP] Most Important & Difficult — double time allocated"), (colors.HexColor("#FF9F43"), "[IMP] Important chapters — extra focus"), (colors.HexColor("#1DD1A1"), "[PAST] Past Paper chapters — practice questions"), (C_MORN, "Morning Slot"), (C_AFTN, "Afternoon Slot"), (C_EVEN, "Evening Slot"), ] leg_rows = [[ Table([[Paragraph("", ParagraphStyle("x"))]], colWidths=[12], rowHeights=[10], style=[("BACKGROUND",(0,0),(-1,-1),c),("BOX",(0,0),(-1,-1),0.5,C_BORDER)]), Paragraph(txt, legend_style) ] for c, txt in legend_items] leg_col_w = [15*mm, 75*mm] leg_table_left = Table(leg_rows[:3], colWidths=leg_col_w) leg_table_right = Table(leg_rows[3:], colWidths=leg_col_w) leg_table_left.setStyle(TableStyle([ ("TOPPADDING",(0,0),(-1,-1),3), ("BOTTOMPADDING",(0,0),(-1,-1),3), ("LEFTPADDING",(0,0),(-1,-1),3), ("RIGHTPADDING",(0,0),(-1,-1),3), ("VALIGN",(0,0),(-1,-1),"MIDDLE"), ])) leg_table_right.setStyle(TableStyle([ ("TOPPADDING",(0,0),(-1,-1),3), ("BOTTOMPADDING",(0,0),(-1,-1),3), ("LEFTPADDING",(0,0),(-1,-1),3), ("RIGHTPADDING",(0,0),(-1,-1),3), ("VALIGN",(0,0),(-1,-1),"MIDDLE"), ])) legend_outer = Table([[leg_table_left, leg_table_right]], colWidths=[95*mm, 90*mm]) legend_outer.setStyle(TableStyle([ ("BOX",(0,0),(-1,-1),1,C_BORDER), ("BACKGROUND",(0,0),(-1,-1),colors.HexColor("#EEF2FF")), ("TOPPADDING",(0,0),(-1,-1),6), ("BOTTOMPADDING",(0,0),(-1,-1),6), ("LEFTPADDING",(0,0),(-1,-1),6), ("RIGHTPADDING",(0,0),(-1,-1),6), ])) leg_title = Table([[Paragraph("LEGEND", ParagraphStyle( "LT", parent=styles["Normal"], fontSize=10, fontName="Helvetica-Bold", textColor=C_WHITE, alignment=TA_LEFT ))]], colWidths=[165*mm]) leg_title.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1),C_ACCENT), ("TOPPADDING",(0,0),(-1,-1),4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ("LEFTPADDING",(0,0),(-1,-1),8), ])) story.append(leg_title) story.append(legend_outer) story.append(Spacer(1, 10*mm)) # ── DAYS ────────────────────────────────────────────────────────────────────── for day_data in schedule: # Day header day_hdr = Table([[Paragraph(day_data["day"], day_header_style)]], colWidths=[165*mm]) day_hdr.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), C_DARK), ("BOX",(0,0),(-1,-1),1.5,C_GOLD), ("TOPPADDING",(0,0),(-1,-1),8), ("BOTTOMPADDING",(0,0),(-1,-1),8), ])) story.append(KeepTogether([day_hdr])) # Revision badge rev_tbl = Table([[Paragraph(day_data["rev"], rev_badge_style)]], colWidths=[165*mm]) rev_tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), day_data["rev_color"]), ("TOPPADDING",(0,0),(-1,-1),4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ])) story.append(rev_tbl) story.append(Spacer(1, 4*mm)) # 3 slot cards side by side slot_cells = [] for s in day_data["slots"]: # build mini table for each slot chap_para = Paragraph(chapter_cell(s["chapters"]), chapter_style) note_para = Paragraph(f"<i>{s['note']}</i>", note_style) cell_data = [ [Paragraph(s["label"], slot_title_style)], [Paragraph(s["time"], slot_time_style)], [chap_para], [note_para], ] ct = Table(cell_data, colWidths=[52*mm]) ct.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,1), s["color"]), ("BACKGROUND",(0,2),(-1,-1), C_LIGHT), ("BOX",(0,0),(-1,-1),1.2,C_BORDER), ("LINEBELOW",(0,1),(0,1),0.8,C_BORDER), ("TOPPADDING",(0,0),(-1,-1),5), ("BOTTOMPADDING",(0,0),(-1,-1),5), ("LEFTPADDING",(0,0),(-1,-1),6), ("RIGHTPADDING",(0,0),(-1,-1),6), ("VALIGN",(0,0),(-1,-1),"TOP"), ])) slot_cells.append(ct) slots_row = Table([slot_cells], colWidths=[55*mm, 55*mm, 55*mm]) slots_row.setStyle(TableStyle([ ("LEFTPADDING",(0,0),(-1,-1),0), ("RIGHTPADDING",(0,0),(-1,-1),2), ("TOPPADDING",(0,0),(-1,-1),0), ("BOTTOMPADDING",(0,0),(-1,-1),0), ("VALIGN",(0,0),(-1,-1),"TOP"), ])) story.append(slots_row) story.append(Spacer(1, 3*mm)) # Tip tip_tbl = Table([[Paragraph(f"💡 <b>Study Tip:</b> {day_data['tip']}", tip_style)]], colWidths=[165*mm]) tip_tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), colors.HexColor("#FFFDE7")), ("BOX",(0,0),(-1,-1),0.8,colors.HexColor("#FFC107")), ("TOPPADDING",(0,0),(-1,-1),6), ("BOTTOMPADDING",(0,0),(-1,-1),6), ("LEFTPADDING",(0,0),(-1,-1),8), ("RIGHTPADDING",(0,0),(-1,-1),8), ])) story.append(tip_tbl) story.append(Spacer(1, 8*mm)) # ── CHAPTER OVERVIEW TABLE ── story.append(HRFlowable(width="100%", thickness=1.5, color=C_ACCENT)) story.append(Spacer(1, 4*mm)) ov_title = Table([[Paragraph("CHAPTER OVERVIEW & PRIORITY", ParagraphStyle( "OVT", parent=styles["Normal"], fontSize=12, fontName="Helvetica-Bold", textColor=C_WHITE, alignment=TA_CENTER ))]], colWidths=[165*mm]) ov_title.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1),C_ACCENT), ("TOPPADDING",(0,0),(-1,-1),6), ("BOTTOMPADDING",(0,0),(-1,-1),6), ])) story.append(ov_title) ov_header = [ Paragraph("<b>#</b>", ParagraphStyle("h", parent=styles["Normal"], fontSize=9, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Chapter</b>", ParagraphStyle("h", parent=styles["Normal"], fontSize=9, fontName="Helvetica-Bold")), Paragraph("<b>Priority</b>", ParagraphStyle("h", parent=styles["Normal"], fontSize=9, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Rev 1</b>", ParagraphStyle("h", parent=styles["Normal"], fontSize=9, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Rev 2</b>", ParagraphStyle("h", parent=styles["Normal"], fontSize=9, fontName="Helvetica-Bold", alignment=TA_CENTER)), ] rev1_slots = {1:"D1 Morn", 2:"D1 Morn", 3:"D1 Aftn", 4:"D1 Aftn", 5:"D1 Eve", 6:"D1 Eve", 7:"D2 Morn", 8:"D2 Morn", 9:"D2 Aftn", 10:"D2 Aftn"} rev2_slots = {1:"D2 Eve", 2:"D2 Eve", 3:"D2 Eve", 4:"D3 Morn", 5:"D3 Morn", 6:"D3 Morn", 7:"D3 Aftn", 8:"D3 Aftn", 9:"D3 Aftn", 10:"D3 Eve"} ov_rows = [ov_header] priority_colors = {"MOST IMP": colors.HexColor("#FFEBEE"), "IMP": colors.HexColor("#FFF3E0"), "PAST": colors.HexColor("#E8F5E9"), "": C_WHITE} for n, (name, tag) in CHAPTERS.items(): bc = badge_color(tag) tag_text = f'<font color="{bc.hexval() if hasattr(bc,"hexval") else "#E94560"}"><b>{tag}</b></font>' if bc else "-" row = [ Paragraph(str(n), ParagraphStyle("r", parent=styles["Normal"], fontSize=9, alignment=TA_CENTER)), Paragraph(name, ParagraphStyle("r", parent=styles["Normal"], fontSize=9)), Paragraph(tag_text, ParagraphStyle("r", parent=styles["Normal"], fontSize=9, alignment=TA_CENTER)), Paragraph(rev1_slots[n], ParagraphStyle("r", parent=styles["Normal"], fontSize=9, alignment=TA_CENTER)), Paragraph(rev2_slots[n], ParagraphStyle("r", parent=styles["Normal"], fontSize=9, alignment=TA_CENTER)), ] ov_rows.append(row) ov_table = Table(ov_rows, colWidths=[12*mm, 75*mm, 28*mm, 25*mm, 25*mm]) ov_style = TableStyle([ ("BACKGROUND",(0,0),(-1,0), C_BLUE), ("TEXTCOLOR",(0,0),(-1,0), C_WHITE), ("GRID",(0,0),(-1,-1),0.5,colors.HexColor("#CCCCCC")), ("TOPPADDING",(0,0),(-1,-1),4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ("LEFTPADDING",(0,0),(-1,-1),5), ("RIGHTPADDING",(0,0),(-1,-1),5), ("VALIGN",(0,0),(-1,-1),"MIDDLE"), ("ROWBACKGROUNDS",(0,1),(-1,-1),[C_WHITE, colors.HexColor("#F5F5FF")]), ]) # highlight important rows for n, (name, tag) in CHAPTERS.items(): row_idx = n # 1-indexed, 0 is header if tag == "MOST IMP": ov_style.add("BACKGROUND", (0, row_idx), (-1, row_idx), colors.HexColor("#FFEBEE")) elif tag == "IMP": ov_style.add("BACKGROUND", (0, row_idx), (-1, row_idx), colors.HexColor("#FFF3E0")) elif tag == "PAST": ov_style.add("BACKGROUND", (0, row_idx), (-1, row_idx), colors.HexColor("#E8F5E9")) ov_table.setStyle(ov_style) story.append(ov_table) story.append(Spacer(1, 8*mm)) # ── EXAM DAY REMINDER ── exam_data = [[Paragraph( "<b>📅 EXAM DAY — Wednesday, June 3, 2026</b><br/>" "Wake up early · review your one-page summary · eat well · arrive 30 min early · stay calm. You've revised everything twice — trust your preparation!", ParagraphStyle("ex", parent=styles["Normal"], fontSize=10, fontName="Helvetica", textColor=C_WHITE, alignment=TA_CENTER, leading=16) )]] exam_tbl = Table(exam_data, colWidths=[165*mm]) exam_tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), C_GOLD), ("BOX",(0,0),(-1,-1),2,C_DARK), ("TOPPADDING",(0,0),(-1,-1),10), ("BOTTOMPADDING",(0,0),(-1,-1),10), ("LEFTPADDING",(0,0),(-1,-1),12), ("RIGHTPADDING",(0,0),(-1,-1),12), ])) story.append(exam_tbl) story.append(Spacer(1, 6*mm)) # ── FOOTER ── story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#AAAAAA"))) story.append(Spacer(1, 2*mm)) story.append(Paragraph("Generated on May 31, 2026 · Organic Chemistry Study Plan · Exam: June 3, 2026", footer_style)) # ── BUILD ────────────────────────────────────────────────────────────────────── doc.build(story) print(f"PDF saved to: {OUTPUT}") PYEOF python3 /home/daytona/workspace/study-plan/generate_plan.py

Writing File

~/study-plan/generate_plan.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import mm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT

OUTPUT = "/home/daytona/workspace/study-plan/Organic_Chemistry_Study_Plan.pdf"

W = A4[0] - 36*mm   # usable width

# ── Colours ────────────────────────────────────────────────────────────────
C_DARK   = colors.HexColor("#1A1A2E")
C_BLUE   = colors.HexColor("#16213E")
C_ACCENT = colors.HexColor("#0F3460")
C_GOLD   = colors.HexColor("#E94560")
C_LIGHT  = colors.HexColor("#F5F5F5")
C_WHITE  = colors.white
C_MORN   = colors.HexColor("#FF6B6B")
C_AFTN   = colors.HexColor("#2ECC71")
C_EVEN   = colors.HexColor("#3498DB")
C_BORDER = colors.HexColor("#0F3460")

def P(text, fs=10, bold=False, italic=False, color=colors.black,
      align=TA_LEFT, leading=None):
    fn = "Helvetica"
    if bold and italic: fn = "Helvetica-BoldOblique"
    elif bold:          fn = "Helvetica-Bold"
    elif italic:        fn = "Helvetica-Oblique"
    kw = dict(fontSize=fs, fontName=fn, textColor=color,
               alignment=align, spaceAfter=0, spaceBefore=0)
    if leading: kw["leading"] = leading
    st = ParagraphStyle("_", **kw)
    return Paragraph(text, st)

def badge(tag):
    if tag == "MOST IMP": return colors.HexColor("#E94560"), "MOST IMP"
    if tag == "IMP":      return colors.HexColor("#FF9F43"), "IMP"
    if tag == "PAST":     return colors.HexColor("#1DD1A1"), "PAST PAPER"
    return None, ""

CHAPTERS = {
    1:  ("Basic Chemistry",                              "IMP"),
    2:  ("Stereochemistry",                              "IMP"),
    3:  ("General Preparation (Alkane/Alkene/Alkyne)",   "PAST"),
    4:  ("Nucleophilic & Electrophilic",                 "PAST"),
    5:  ("Orientation of Benzene",                       ""),
    6:  ("Heterocyclic Compounds",                       "IMP"),
    7:  ("Reaction Mechanism",                           "MOST IMP"),
    8:  ("Intermediates & Free Radicals",                ""),
    9:  ("Carbonium Rearrangements",                     ""),
    10: ("Carbanion Rearrangements",                     "MOST IMP"),
}

def chap_lines(nums):
    """Return a list of Paragraph objects for a set of chapter numbers."""
    out = []
    for n in nums:
        name, tag = CHAPTERS[n]
        bc, blabel = badge(tag)
        if bc:
            line = f'<b>Ch {n}.</b> {name}  <font color="{bc.hexval()}"><b>[{blabel}]</b></font>'
        else:
            line = f'<b>Ch {n}.</b> {name}'
        out.append(P(line, fs=9, leading=13))
    return out

def make_slot(label, time_str, chapters, bg_color, note):
    """Return a Table representing one slot card."""
    chap_paras = chap_lines(chapters)
    chap_table_rows = [[c] for c in chap_paras]
    # add note row
    chap_table_rows.append([P(note, fs=8, italic=True,
                               color=colors.HexColor("#555577"), leading=12)])

    inner = Table(chap_table_rows, colWidths=[W/3 - 10*mm])
    inner.setStyle(TableStyle([
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING",   (0,0), (-1,-1), 0),
        ("RIGHTPADDING",  (0,0), (-1,-1), 0),
    ]))

    data = [
        [P(label,    fs=11, bold=True, color=C_WHITE,  align=TA_CENTER)],
        [P(time_str, fs=8,  italic=True, color=colors.HexColor("#F0F0F0"), align=TA_CENTER)],
        [inner],
    ]
    t = Table(data, colWidths=[W/3 - 4*mm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (0,1), bg_color),
        ("BACKGROUND",    (0,2), (0,2), C_LIGHT),
        ("BOX",           (0,0), (-1,-1), 1.2, C_BORDER),
        ("LINEBELOW",     (0,1), (0,1), 0.8, C_BORDER),
        ("TOPPADDING",    (0,0), (0,1), 6),
        ("BOTTOMPADDING", (0,0), (0,1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("RIGHTPADDING",  (0,0), (-1,-1), 6),
        ("TOPPADDING",    (0,2), (0,2), 6),
        ("BOTTOMPADDING", (0,2), (0,2), 6),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ]))
    return t

# ─── Schedule ────────────────────────────────────────────────────────────────
schedule = [
    {
        "day":   "DAY 1  -  Sunday, May 31, 2026",
        "rev":   "REVISION 1  |  Chapters 1 to 6",
        "rev_c": colors.HexColor("#FFD700"),
        "slots": [
            dict(label="Morning",   time="8:00 AM - 11:00 AM  (3 hrs)",
                 chapters=[1,2], bg=C_MORN,
                 note="Basic Chemistry & Stereochemistry - read + write key points"),
            dict(label="Afternoon", time="1:00 PM - 4:00 PM  (3 hrs)",
                 chapters=[3,4], bg=C_AFTN,
                 note="Practice past paper questions for Ch 3 & 4"),
            dict(label="Evening",   time="6:00 PM - 9:00 PM  (3 hrs)",
                 chapters=[5,6], bg=C_EVEN,
                 note="Benzene orientation + Heterocyclic - focus on Ch 6 (IMP)"),
        ],
        "tip": "Day 1: Build the foundation. Read actively, write reaction summaries, and mark unclear points for Day 3 review.",
    },
    {
        "day":   "DAY 2  -  Monday, June 1, 2026",
        "rev":   "REVISION 1 cont. (Ch 7-10)  +  REVISION 2 Start (Ch 1-3)",
        "rev_c": colors.HexColor("#FFD700"),
        "slots": [
            dict(label="Morning",   time="7:00 AM - 12:00 PM  (5 hrs - EXTENDED)",
                 chapters=[7,8], bg=C_MORN,
                 note="REACTION MECHANISM gets a full 5-hr block - work every mechanism from scratch"),
            dict(label="Afternoon", time="1:00 PM - 4:30 PM  (3.5 hrs)",
                 chapters=[9,10], bg=C_AFTN,
                 note="Ch 10 MOST IMP - spend extra 30 min on Carbanion rearrangements"),
            dict(label="Evening",   time="6:00 PM - 9:30 PM  (3.5 hrs)",
                 chapters=[1,2,3], bg=C_EVEN,
                 note="REVISION 2 begins - focused re-read of Ch 1-3, test yourself"),
        ],
        "tip": "Day 2: Tackle Reaction Mechanism first thing when you are sharpest. Draw every mechanism by hand - do not just read.",
    },
    {
        "day":   "DAY 3  -  Tuesday, June 2, 2026",
        "rev":   "REVISION 2 cont.  |  Ch 4-10  +  Full Syllabus Recap",
        "rev_c": colors.HexColor("#50C878"),
        "slots": [
            dict(label="Morning",   time="7:00 AM - 11:00 AM  (4 hrs)",
                 chapters=[4,5,6], bg=C_MORN,
                 note="Ch 4 past paper practice + Ch 6 IMP deep review"),
            dict(label="Afternoon", time="12:00 PM - 4:30 PM  (4.5 hrs - EXTENDED)",
                 chapters=[7,8,9], bg=C_AFTN,
                 note="Re-do all mechanism problems + Intermediates + Carbonium rearrangements"),
            dict(label="Evening",   time="6:00 PM - 9:00 PM  (3 hrs)",
                 chapters=[10], bg=C_EVEN,
                 note="Carbanion Rearrangements MOST IMP - deep dive + write full syllabus recap from memory"),
        ],
        "tip": "Day 3 evening: After Ch 10, write a one-page summary of EVERY chapter from memory. This is the most powerful last-night revision technique.",
    },
]

# ─── Build PDF ───────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    rightMargin=18*mm, leftMargin=18*mm,
    topMargin=18*mm, bottomMargin=18*mm
)
story = []

# ── Cover Banner ──
def banner_table(text, fs, bold, bg, text_color=C_WHITE, border_color=None, pad_v=10):
    t = Table([[P(text, fs=fs, bold=bold, color=text_color, align=TA_CENTER)]],
              colWidths=[W])
    style = [
        ("BACKGROUND",    (0,0), (-1,-1), bg),
        ("TOPPADDING",    (0,0), (-1,-1), pad_v),
        ("BOTTOMPADDING", (0,0), (-1,-1), pad_v),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
    ]
    if border_color:
        style.append(("BOX", (0,0), (-1,-1), 2, border_color))
    t.setStyle(TableStyle(style))
    return t

story.append(banner_table("ORGANIC CHEMISTRY", 26, True, C_DARK, C_WHITE, C_GOLD, 18))
story.append(banner_table("3-Day Exam Study Plan  -  2 Full Revisions", 12, True,
                           C_ACCENT, colors.HexColor("#FFE082"), pad_v=7))
story.append(banner_table("Study Period: May 31 - June 2, 2026   |   Exam: June 3, 2026",
                           10, False, C_BLUE, colors.HexColor("#AAAACC"), pad_v=5))
story.append(Spacer(1, 8*mm))

# ── Legend ──
leg_data = [
    (colors.HexColor("#E94560"), "[MOST IMP]  Most Important & Difficult - extended time slots"),
    (colors.HexColor("#FF9F43"), "[IMP]            Important chapters - extra focus"),
    (colors.HexColor("#1DD1A1"), "[PAST PAPER]  Past paper chapters - practice questions"),
]
leg_rows = []
for c, txt in leg_data:
    dot = Table([[""]], colWidths=[10*mm], rowHeights=[8*mm])
    dot.setStyle(TableStyle([
        ("BACKGROUND",(0,0),(-1,-1),c),
        ("TOPPADDING",(0,0),(-1,-1),0),
        ("BOTTOMPADDING",(0,0),(-1,-1),0),
    ]))
    leg_rows.append([dot, P(txt, fs=9)])

leg_inner = Table(leg_rows, colWidths=[12*mm, W - 12*mm])
leg_inner.setStyle(TableStyle([
    ("TOPPADDING",    (0,0),(-1,-1), 2),
    ("BOTTOMPADDING", (0,0),(-1,-1), 2),
    ("LEFTPADDING",   (0,0),(-1,-1), 4),
    ("RIGHTPADDING",  (0,0),(-1,-1), 4),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))

leg_outer = Table(
    [[P("LEGEND", fs=10, bold=True, color=C_WHITE)],
     [leg_inner]],
    colWidths=[W]
)
leg_outer.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(0,0), C_ACCENT),
    ("BACKGROUND",    (0,1),(0,1), colors.HexColor("#EEF2FF")),
    ("BOX",           (0,0),(-1,-1), 1, C_BORDER),
    ("TOPPADDING",    (0,0),(0,0), 5),
    ("BOTTOMPADDING", (0,0),(0,0), 5),
    ("LEFTPADDING",   (0,0),(-1,-1), 8),
    ("TOPPADDING",    (0,1),(0,1), 5),
    ("BOTTOMPADDING", (0,1),(0,1), 5),
]))
story.append(leg_outer)
story.append(Spacer(1, 8*mm))

# ── Days ──
for d in schedule:
    story.append(banner_table(d["day"], 15, True, C_DARK, C_WHITE, C_GOLD, 8))
    story.append(banner_table(d["rev"], 9, True, d["rev_c"],
                               C_DARK, pad_v=4))
    story.append(Spacer(1, 3*mm))

    s0 = d["slots"][0]
    s1 = d["slots"][1]
    s2 = d["slots"][2]

    c0 = make_slot(s0["label"], s0["time"], s0["chapters"], s0["bg"], s0["note"])
    c1 = make_slot(s1["label"], s1["time"], s1["chapters"], s1["bg"], s1["note"])
    c2 = make_slot(s2["label"], s2["time"], s2["chapters"], s2["bg"], s2["note"])

    row = Table([[c0, c1, c2]],
                colWidths=[W/3, W/3, W/3])
    row.setStyle(TableStyle([
        ("LEFTPADDING",   (0,0),(-1,-1), 2),
        ("RIGHTPADDING",  (0,0),(-1,-1), 2),
        ("TOPPADDING",    (0,0),(-1,-1), 0),
        ("BOTTOMPADDING", (0,0),(-1,-1), 0),
        ("VALIGN",        (0,0),(-1,-1), "TOP"),
    ]))
    story.append(row)
    story.append(Spacer(1, 3*mm))

    # tip
    tip_t = Table([[P(f"Study Tip:  {d['tip']}", fs=9, italic=False,
                       color=colors.HexColor("#4A4000"), leading=13)]],
                  colWidths=[W])
    tip_t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), colors.HexColor("#FFFDE7")),
        ("BOX",           (0,0),(-1,-1), 0.8, colors.HexColor("#FFC107")),
        ("TOPPADDING",    (0,0),(-1,-1), 6),
        ("BOTTOMPADDING", (0,0),(-1,-1), 6),
        ("LEFTPADDING",   (0,0),(-1,-1), 10),
        ("RIGHTPADDING",  (0,0),(-1,-1), 10),
    ]))
    story.append(tip_t)
    story.append(Spacer(1, 8*mm))

# ── Chapter Overview Table ──
story.append(HRFlowable(width="100%", thickness=1.5, color=C_ACCENT))
story.append(Spacer(1, 4*mm))
story.append(banner_table("CHAPTER OVERVIEW & PRIORITY GUIDE", 12, True,
                           C_ACCENT, C_WHITE, pad_v=6))

REV1 = {1:"D1 Morn",2:"D1 Morn",3:"D1 Aftn",4:"D1 Aftn",
         5:"D1 Eve", 6:"D1 Eve", 7:"D2 Morn",8:"D2 Morn",
         9:"D2 Aftn",10:"D2 Aftn"}
REV2 = {1:"D2 Eve", 2:"D2 Eve", 3:"D2 Eve", 4:"D3 Morn",
         5:"D3 Morn",6:"D3 Morn",7:"D3 Aftn",8:"D3 Aftn",
         9:"D3 Aftn",10:"D3 Eve"}

hdr = [P(x, fs=9, bold=True, color=C_WHITE, align=TA_CENTER)
       for x in ["#", "Chapter Name", "Priority", "Revision 1", "Revision 2"]]
ov_rows = [hdr]

ov_row_colors = {}
for n,(name,tag) in CHAPTERS.items():
    bc, blabel = badge(tag)
    if bc:
        ptxt = f'<font color="{bc.hexval()}"><b>{blabel}</b></font>'
    else:
        ptxt = "-"
    row = [
        P(str(n), fs=9, align=TA_CENTER),
        P(name, fs=9),
        P(ptxt, fs=9, align=TA_CENTER),
        P(REV1[n], fs=9, align=TA_CENTER),
        P(REV2[n], fs=9, align=TA_CENTER),
    ]
    ov_rows.append(row)
    if tag == "MOST IMP":
        ov_row_colors[n] = colors.HexColor("#FFEBEE")
    elif tag == "IMP":
        ov_row_colors[n] = colors.HexColor("#FFF3E0")
    elif tag == "PAST":
        ov_row_colors[n] = colors.HexColor("#E8F5E9")

ov_table = Table(ov_rows, colWidths=[12*mm, 75*mm, 28*mm, 25*mm, 25*mm])
ov_style = [
    ("BACKGROUND",    (0,0),(-1,0), C_BLUE),
    ("GRID",          (0,0),(-1,-1), 0.5, colors.HexColor("#CCCCCC")),
    ("TOPPADDING",    (0,0),(-1,-1), 4),
    ("BOTTOMPADDING", (0,0),(-1,-1), 4),
    ("LEFTPADDING",   (0,0),(-1,-1), 5),
    ("RIGHTPADDING",  (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[C_WHITE, colors.HexColor("#F5F5FF")]),
]
for n, c in ov_row_colors.items():
    ov_style.append(("BACKGROUND", (0, n), (-1, n), c))

ov_table.setStyle(TableStyle(ov_style))
story.append(ov_table)
story.append(Spacer(1, 8*mm))

# ── Exam Day Banner ──
story.append(Table(
    [[P("EXAM DAY  -  Wednesday, June 3, 2026", fs=13, bold=True,
        color=C_DARK, align=TA_CENTER)],
     [P("Wake up early  -  Review your one-page summary  -  Eat well  -  Arrive 30 min early"
        "  -  Stay calm. You have revised everything twice!", fs=10,
        color=C_DARK, align=TA_CENTER, leading=16)]],
    colWidths=[W],
    style=[
        ("BACKGROUND",(0,0),(-1,-1), colors.HexColor("#FFD700")),
        ("BOX",(0,0),(-1,-1), 2, C_DARK),
        ("TOPPADDING",(0,0),(-1,-1), 8),
        ("BOTTOMPADDING",(0,0),(-1,-1), 8),
        ("LEFTPADDING",(0,0),(-1,-1), 12),
        ("RIGHTPADDING",(0,0),(-1,-1), 12),
    ]
))
story.append(Spacer(1, 6*mm))

# ── Footer ──
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#AAAAAA")))
story.append(Spacer(1, 2*mm))
story.append(P("Generated May 31, 2026  -  Organic Chemistry Study Plan  -  Exam: June 3, 2026",
               fs=8, italic=True, color=colors.HexColor("#999999"), align=TA_CENTER))

doc.build(story)
print(f"PDF saved: {OUTPUT}")
Editing File

~/study-plan/generate_plan.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/study-plan/generate_plan.py'
Running Command

cat << 'PYEOF' > /home/daytona/workspace/study-plan/gen2.py from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import ParagraphStyle from reportlab.lib.units import mm from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable ) from reportlab.lib.enums import TA_CENTER, TA_LEFT OUTPUT = "/home/daytona/workspace/study-plan/Organic_Chemistry_Study_Plan.pdf" W = A4[0] - 36*mm C_DARK = colors.HexColor("#1A1A2E") C_BLUE = colors.HexColor("#16213E") C_ACC = colors.HexColor("#0F3460") C_GOLD = colors.HexColor("#E94560") C_LIGHT = colors.HexColor("#F5F5F5") C_WHITE = colors.white C_BDR = colors.HexColor("#0F3460") C_MORN = colors.HexColor("#FF6B6B") C_AFTN = colors.HexColor("#2ECC71") C_EVEN = colors.HexColor("#3498DB") def ps(fs=10, bold=False, italic=False, color=colors.black, align=TA_LEFT, leading=None): fn = "Helvetica" if bold and italic: fn = "Helvetica-BoldOblique" elif bold: fn = "Helvetica-Bold" elif italic: fn = "Helvetica-Oblique" kw = dict(fontSize=fs, fontName=fn, textColor=color, alignment=align, spaceAfter=0, spaceBefore=0) if leading: kw["leading"] = leading return ParagraphStyle("_dyn", **kw) def P(txt, **kw): return Paragraph(txt, ps(**kw)) def banner(txt, fs=10, bold=True, bg=C_DARK, tc=C_WHITE, border=None, pv=8): t = Table([[P(txt, fs=fs, bold=bold, color=tc, align=TA_CENTER)]], colWidths=[W]) s = [("BACKGROUND",(0,0),(-1,-1),bg), ("TOPPADDING",(0,0),(-1,-1),pv), ("BOTTOMPADDING",(0,0),(-1,-1),pv), ("LEFTPADDING",(0,0),(-1,-1),10), ("RIGHTPADDING",(0,0),(-1,-1),10)] if border: s.append(("BOX",(0,0),(-1,-1),2,border)) t.setStyle(TableStyle(s)) return t CHAPS = { 1: ("Basic Chemistry", "IMP"), 2: ("Stereochemistry", "IMP"), 3: ("General Prep (Alkane/Alkene/Alkyne)", "PAST"), 4: ("Nucleophilic and Electrophilic", "PAST"), 5: ("Orientation of Benzene", ""), 6: ("Heterocyclic Compounds", "IMP"), 7: ("Reaction Mechanism", "MOST IMP"), 8: ("Intermediates and Free Radicals", ""), 9: ("Carbonium Rearrangements", ""), 10: ("Carbanion Rearrangements", "MOST IMP"), } TAG_COLORS = { "MOST IMP": colors.HexColor("#E94560"), "IMP": colors.HexColor("#FF9F43"), "PAST": colors.HexColor("#1DD1A1"), } def chap_paras(nums): out = [] for n in nums: name, tag = CHAPS[n] if tag in TAG_COLORS: tc = TAG_COLORS[tag].hexval() line = f'<b>Ch {n}.</b> {name} <font color="{tc}"><b>[{tag}]</b></font>' else: line = f'<b>Ch {n}.</b> {name}' out.append(P(line, fs=9, leading=14)) return out def slot_card(label, time_s, nums, bg, note): body_rows = [[p] for p in chap_paras(nums)] body_rows.append([P(note, fs=8, italic=True, color=colors.HexColor("#444466"), leading=12)]) body = Table(body_rows, colWidths=[W/3 - 10*mm]) body.setStyle(TableStyle([ ("TOPPADDING",(0,0),(-1,-1),2),("BOTTOMPADDING",(0,0),(-1,-1),2), ("LEFTPADDING",(0,0),(-1,-1),0),("RIGHTPADDING",(0,0),(-1,-1),0), ])) card = Table([ [P(label, fs=11, bold=True, color=C_WHITE, align=TA_CENTER)], [P(time_s, fs=8, italic=True, color=colors.HexColor("#F0F0F0"), align=TA_CENTER)], [body], ], colWidths=[W/3 - 4*mm]) card.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,1),bg), ("BACKGROUND",(0,2),(0,2),C_LIGHT), ("BOX",(0,0),(-1,-1),1.2,C_BDR), ("LINEBELOW",(0,1),(0,1),0.8,C_BDR), ("TOPPADDING",(0,0),(0,1),6),("BOTTOMPADDING",(0,0),(0,1),6), ("TOPPADDING",(0,2),(0,2),6),("BOTTOMPADDING",(0,2),(0,2),6), ("LEFTPADDING",(0,0),(-1,-1),6),("RIGHTPADDING",(0,0),(-1,-1),6), ("VALIGN",(0,0),(-1,-1),"TOP"), ])) return card SCHED = [ dict( day="DAY 1 - Sunday, May 31, 2026", rev="REVISION 1 | Chapters 1 to 6", rev_c=colors.HexColor("#FFD700"), slots=[ dict(label="Morning", time="8:00 AM - 11:00 AM (3 hrs)", nums=[1,2], bg=C_MORN, note="Build foundation: read + write key points for Basic Chem & Stereochemistry"), dict(label="Afternoon", time="1:00 PM - 4:00 PM (3 hrs)", nums=[3,4], bg=C_AFTN, note="Practice past paper questions on preparations and reaction types"), dict(label="Evening", time="6:00 PM - 9:00 PM (3 hrs)", nums=[5,6], bg=C_EVEN, note="Benzene orientation + Heterocyclic - give extra 45 min to Ch 6 (IMP)"), ], tip="Day 1: Read actively. Write reaction summaries in your own words. Mark anything unclear for Day 3 review.", ), dict( day="DAY 2 - Monday, June 1, 2026", rev="REVISION 1 cont. (Ch 7-10) + REVISION 2 Starts (Ch 1-3)", rev_c=colors.HexColor("#FFD700"), slots=[ dict(label="Morning", time="7:00 AM - 12:00 PM (5 hrs EXTENDED)", nums=[7,8], bg=C_MORN, note="Reaction Mechanism gets the full 5-hr block - draw every mechanism by hand"), dict(label="Afternoon", time="1:00 PM - 4:30 PM (3.5 hrs)", nums=[9,10], bg=C_AFTN, note="Ch 10 MOST IMP - spend extra 30 min on Carbanion rearrangements"), dict(label="Evening", time="6:00 PM - 9:30 PM (3.5 hrs)", nums=[1,2,3], bg=C_EVEN, note="REVISION 2 starts - focused re-read of Ch 1-3, quiz yourself on each"), ], tip="Day 2: Attack Reaction Mechanism first when your brain is sharpest. Never just read mechanisms - draw them.", ), dict( day="DAY 3 - Tuesday, June 2, 2026", rev="REVISION 2 cont. | Ch 4-10 + Full Syllabus Recap", rev_c=colors.HexColor("#50C878"), slots=[ dict(label="Morning", time="7:00 AM - 11:00 AM (4 hrs)", nums=[4,5,6], bg=C_MORN, note="Ch 4 past paper practice + Ch 6 IMP deep review + Benzene recap"), dict(label="Afternoon", time="12:00 PM - 4:30 PM (4.5 hrs EXTENDED)", nums=[7,8,9], bg=C_AFTN, note="Re-do all mechanism problems + Free Radicals + Carbonium rearrangements"), dict(label="Evening", time="6:00 PM - 9:00 PM (3 hrs)", nums=[10], bg=C_EVEN, note="MOST IMP - Carbanion deep dive + write full syllabus recap from memory"), ], tip="Day 3 evening: After Ch 10, spend 30 min writing a one-page summary of every chapter from memory. Best last-night strategy.", ), ] doc = SimpleDocTemplate(OUTPUT, pagesize=A4, rightMargin=18*mm, leftMargin=18*mm, topMargin=18*mm, bottomMargin=18*mm) story = [] story.append(banner("ORGANIC CHEMISTRY", fs=26, bg=C_DARK, border=C_GOLD, pv=18)) story.append(banner("3-Day Exam Study Plan - 2 Full Revisions", fs=12, bg=C_ACC, tc=colors.HexColor("#FFE082"), pv=7)) story.append(banner("Study Period: May 31 - June 2, 2026 | Exam: June 3, 2026", fs=10, bold=False, bg=C_BLUE, tc=colors.HexColor("#AAAACC"), pv=5)) story.append(Spacer(1, 8*mm)) # Legend leg_rows = [] for tag, c in TAG_COLORS.items(): dot = Table([[""]], colWidths=[8*mm], rowHeights=[8*mm]) dot.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),c), ("TOPPADDING",(0,0),(-1,-1),0), ("BOTTOMPADDING",(0,0),(-1,-1),0)])) leg_rows.append([dot, P(f"[{tag}] - Most Important" if tag=="MOST IMP" else f"[{tag}] - Important chapter" if tag=="IMP" else f"[{tag}] - Past paper chapter", fs=9)]) leg_inner = Table(leg_rows, colWidths=[12*mm, W-12*mm]) leg_inner.setStyle(TableStyle([ ("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3), ("LEFTPADDING",(0,0),(-1,-1),4),("RIGHTPADDING",(0,0),(-1,-1),4), ("VALIGN",(0,0),(-1,-1),"MIDDLE"), ])) leg_box = Table( [[P("LEGEND", fs=10, bold=True, color=C_WHITE)], [leg_inner]], colWidths=[W] ) leg_box.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,0),C_ACC), ("BACKGROUND",(0,1),(0,1),colors.HexColor("#EEF2FF")), ("BOX",(0,0),(-1,-1),1,C_BDR), ("TOPPADDING",(0,0),(0,0),5),("BOTTOMPADDING",(0,0),(0,0),5), ("TOPPADDING",(0,1),(0,1),5),("BOTTOMPADDING",(0,1),(0,1),5), ("LEFTPADDING",(0,0),(-1,-1),8),("RIGHTPADDING",(0,0),(-1,-1),8), ])) story.append(leg_box) story.append(Spacer(1, 8*mm)) for d in SCHED: story.append(banner(d["day"], fs=15, bg=C_DARK, border=C_GOLD, pv=8)) story.append(banner(d["rev"], fs=9, bg=d["rev_c"], tc=C_DARK, pv=4)) story.append(Spacer(1, 3*mm)) cards = [slot_card(s["label"], s["time"], s["nums"], s["bg"], s["note"]) for s in d["slots"]] row = Table([cards], colWidths=[W/3, W/3, W/3]) row.setStyle(TableStyle([ ("LEFTPADDING",(0,0),(-1,-1),2),("RIGHTPADDING",(0,0),(-1,-1),2), ("TOPPADDING",(0,0),(-1,-1),0),("BOTTOMPADDING",(0,0),(-1,-1),0), ("VALIGN",(0,0),(-1,-1),"TOP"), ])) story.append(row) story.append(Spacer(1, 3*mm)) tip = Table([[P(f"Tip: {d['tip']}", fs=9, color=colors.HexColor("#4A4000"), leading=13)]], colWidths=[W]) tip.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1),colors.HexColor("#FFFDE7")), ("BOX",(0,0),(-1,-1),0.8,colors.HexColor("#FFC107")), ("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6), ("LEFTPADDING",(0,0),(-1,-1),10),("RIGHTPADDING",(0,0),(-1,-1),10), ])) story.append(tip) story.append(Spacer(1, 8*mm)) # Chapter overview story.append(HRFlowable(width="100%", thickness=1.5, color=C_ACC)) story.append(Spacer(1, 4*mm)) story.append(banner("CHAPTER OVERVIEW AND PRIORITY GUIDE", fs=12, bg=C_ACC, pv=6)) REV1 = {1:"D1 Morn",2:"D1 Morn",3:"D1 Aftn",4:"D1 Aftn", 5:"D1 Eve",6:"D1 Eve",7:"D2 Morn",8:"D2 Morn",9:"D2 Aftn",10:"D2 Aftn"} REV2 = {1:"D2 Eve",2:"D2 Eve",3:"D2 Eve",4:"D3 Morn", 5:"D3 Morn",6:"D3 Morn",7:"D3 Aftn",8:"D3 Aftn",9:"D3 Aftn",10:"D3 Eve"} hdr = [P(x, fs=9, bold=True, color=C_WHITE, align=TA_CENTER) for x in ["#","Chapter","Priority","Rev 1","Rev 2"]] ov = [hdr] ov_bg = {} for n,(name,tag) in CHAPS.items(): if tag in TAG_COLORS: tc = TAG_COLORS[tag].hexval() ptxt = f'<font color="{tc}"><b>{tag}</b></font>' else: ptxt = "-" ov.append([P(str(n),fs=9,align=TA_CENTER), P(name,fs=9), P(ptxt,fs=9,align=TA_CENTER), P(REV1[n],fs=9,align=TA_CENTER), P(REV2[n],fs=9,align=TA_CENTER)]) if tag=="MOST IMP": ov_bg[n]=colors.HexColor("#FFEBEE") elif tag=="IMP": ov_bg[n]=colors.HexColor("#FFF3E0") elif tag=="PAST": ov_bg[n]=colors.HexColor("#E8F5E9") ov_t = Table(ov, colWidths=[12*mm,74*mm,28*mm,24*mm,24*mm]) ov_s = [ ("BACKGROUND",(0,0),(-1,0),C_BLUE), ("GRID",(0,0),(-1,-1),0.5,colors.HexColor("#CCCCCC")), ("TOPPADDING",(0,0),(-1,-1),4),("BOTTOMPADDING",(0,0),(-1,-1),4), ("LEFTPADDING",(0,0),(-1,-1),5),("RIGHTPADDING",(0,0),(-1,-1),5), ("VALIGN",(0,0),(-1,-1),"MIDDLE"), ("ROWBACKGROUNDS",(0,1),(-1,-1),[C_WHITE,colors.HexColor("#F5F5FF")]), ] for n,c in ov_bg.items(): ov_s.append(("BACKGROUND",(0,n),(-1,n),c)) ov_t.setStyle(TableStyle(ov_s)) story.append(ov_t) story.append(Spacer(1, 8*mm)) exam = Table([ [P("EXAM DAY - Wednesday, June 3, 2026", fs=13, bold=True, color=C_DARK, align=TA_CENTER)], [P("Wake up early - Review your one-page summary - Eat well - Arrive 30 min early - Stay calm. You have revised everything twice!", fs=10, color=C_DARK, align=TA_CENTER, leading=16)] ], colWidths=[W]) exam.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1),colors.HexColor("#FFD700")), ("BOX",(0,0),(-1,-1),2,C_DARK), ("TOPPADDING",(0,0),(-1,-1),8),("BOTTOMPADDING",(0,0),(-1,-1),8), ("LEFTPADDING",(0,0),(-1,-1),12),("RIGHTPADDING",(0,0),(-1,-1),12), ])) story.append(exam) story.append(Spacer(1, 6*mm)) story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#AAAAAA"))) story.append(Spacer(1, 2*mm)) story.append(P("Generated May 31, 2026 - Organic Chemistry Study Plan - Exam: June 3, 2026", fs=8, italic=True, color=colors.HexColor("#999999"), align=TA_CENTER)) doc.build(story) print(f"Done: {OUTPUT}") PYEOF python3 /home/daytona/workspace/study-plan/gen2.py

PDF generated successfully. Here is your complete 3-day study plan:

Organic Chemistry - 3 Day Study Plan

Period: May 31 - June 2, 2026 | Exam: June 3, 2026

DAY 1 - Sunday, May 31 | REVISION 1 (Ch 1-6)

SlotTimeChapters
Morning8:00 AM - 11:00 AM (3 hrs)Ch 1. Basic Chemistry [IMP] + Ch 2. Stereochemistry [IMP]
Afternoon1:00 PM - 4:00 PM (3 hrs)Ch 3. General Prep [PAST] + Ch 4. Nucleophilic & Electrophilic [PAST]
Evening6:00 PM - 9:00 PM (3 hrs)Ch 5. Orientation of Benzene + Ch 6. Heterocyclic [IMP]
Build foundation. Read actively, write reaction summaries, mark unclear points.

DAY 2 - Monday, June 1 | REVISION 1 cont. (Ch 7-10) + REVISION 2 Start (Ch 1-3)

SlotTimeChapters
Morning7:00 AM - 12:00 PM (5 hrs - EXTENDED)Ch 7. Reaction Mechanism [MOST IMP] + Ch 8. Intermediates & Free Radicals
Afternoon1:00 PM - 4:30 PM (3.5 hrs)Ch 9. Carbonium Rearrangements + Ch 10. Carbanion Rearrangements [MOST IMP]
Evening6:00 PM - 9:30 PM (3.5 hrs)Revision 2 begins - Ch 1, 2, 3 (re-read + self-quiz)
Tackle Reaction Mechanism first thing. Draw every mechanism by hand - never just read.

DAY 3 - Tuesday, June 2 | REVISION 2 cont. (Ch 4-10) + Full Recap

SlotTimeChapters
Morning7:00 AM - 11:00 AM (4 hrs)Ch 4. Nucleophilic [PAST] + Ch 5. Benzene + Ch 6. Heterocyclic [IMP]
Afternoon12:00 PM - 4:30 PM (4.5 hrs - EXTENDED)Ch 7. Reaction Mechanism [MOST IMP] + Ch 8. Free Radicals + Ch 9. Carbonium
Evening6:00 PM - 9:00 PM (3 hrs)Ch 10. Carbanion Rearrangements [MOST IMP] + Full syllabus recap from memory
Evening: After Ch 10, write a one-page summary of every chapter from memory - best last-night technique.

Priority key: [MOST IMP] = extended slots | [IMP] = extra focus | [PAST] = past paper practice
Download your PDF here:

Organic Chemistry Study Plan

PDF Document · PDF

This is a shared conversation. Sign in to Orris to start your own chat.