~/ruhs-microbio/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
OUTPUT = "/home/daytona/workspace/ruhs-microbio/RUHS_Microbiology_Priority_List.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=1.8*cm, leftMargin=1.8*cm,
topMargin=1.8*cm, bottomMargin=1.8*cm
)
styles = getSampleStyleSheet()
# Custom styles
title_style = ParagraphStyle(
'TitleStyle', parent=styles['Normal'],
fontSize=18, fontName='Helvetica-Bold',
textColor=colors.HexColor('#1a237e'),
alignment=TA_CENTER, spaceAfter=4
)
subtitle_style = ParagraphStyle(
'SubtitleStyle', parent=styles['Normal'],
fontSize=11, fontName='Helvetica',
textColor=colors.HexColor('#37474f'),
alignment=TA_CENTER, spaceAfter=2
)
note_style = ParagraphStyle(
'NoteStyle', parent=styles['Normal'],
fontSize=9, fontName='Helvetica-Oblique',
textColor=colors.HexColor('#546e7a'),
alignment=TA_CENTER, spaceAfter=8
)
unit_heading_style = ParagraphStyle(
'UnitHeading', parent=styles['Normal'],
fontSize=13, fontName='Helvetica-Bold',
textColor=colors.white,
alignment=TA_LEFT, spaceAfter=0, spaceBefore=0,
leftIndent=6
)
priority_label_style = ParagraphStyle(
'PriorityLabel', parent=styles['Normal'],
fontSize=10, fontName='Helvetica-Bold',
textColor=colors.HexColor('#b71c1c'),
spaceBefore=8, spaceAfter=4
)
priority_label_med = ParagraphStyle(
'PriorityLabelMed', parent=styles['Normal'],
fontSize=10, fontName='Helvetica-Bold',
textColor=colors.HexColor('#e65100'),
spaceBefore=6, spaceAfter=4
)
priority_label_low = ParagraphStyle(
'PriorityLabelLow', parent=styles['Normal'],
fontSize=10, fontName='Helvetica-Bold',
textColor=colors.HexColor('#1b5e20'),
spaceBefore=6, spaceAfter=4
)
body_style = ParagraphStyle(
'BodyStyle', parent=styles['Normal'],
fontSize=9, fontName='Helvetica',
textColor=colors.HexColor('#212121'),
spaceAfter=2, leftIndent=4
)
footer_style = ParagraphStyle(
'FooterStyle', parent=styles['Normal'],
fontSize=8, fontName='Helvetica-Oblique',
textColor=colors.HexColor('#78909c'),
alignment=TA_CENTER
)
# ---- Color scheme per unit ----
UNIT_COLORS = {
1: colors.HexColor('#1565c0'), # deep blue
2: colors.HexColor('#6a1b9a'), # deep purple
3: colors.HexColor('#00695c'), # teal
4: colors.HexColor('#bf360c'), # deep orange
5: colors.HexColor('#558b2f'), # green
}
def unit_header(num, title, code_range, competency_count, color):
data = [[Paragraph(f"UNIT {num} | {title} ({code_range}) | {competency_count} Competencies", unit_heading_style)]]
t = Table(data, colWidths=[17.4*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('ROWBACKGROUNDS', (0,0), (-1,-1), [color]),
('BOX', (0,0), (-1,-1), 0.5, colors.white),
('TOPPADDING', (0,0), (-1,-1), 7),
('BOTTOMPADDING', (0,0), (-1,-1), 7),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
return t
def priority_table(rows, priority):
"""rows: list of (sno, topic, reason)"""
if priority == 'high':
header_bg = colors.HexColor('#ffcdd2')
header_fg = colors.HexColor('#b71c1c')
row_bg1 = colors.HexColor('#fff8f8')
row_bg2 = colors.white
label = "HIGH PRIORITY"
badge = colors.HexColor('#e53935')
elif priority == 'medium':
header_bg = colors.HexColor('#ffe0b2')
header_fg = colors.HexColor('#e65100')
row_bg1 = colors.HexColor('#fffbf5')
row_bg2 = colors.white
label = "MEDIUM PRIORITY"
badge = colors.HexColor('#fb8c00')
else:
header_bg = colors.HexColor('#dcedc8')
header_fg = colors.HexColor('#1b5e20')
row_bg1 = colors.HexColor('#f9fbe7')
row_bg2 = colors.white
label = "LOW PRIORITY"
badge = colors.HexColor('#43a047')
# Header row
h_sno = Paragraph('<b>#</b>', ParagraphStyle('hdr', fontName='Helvetica-Bold', fontSize=9, textColor=header_fg))
h_topic = Paragraph('<b>Topic</b>', ParagraphStyle('hdr', fontName='Helvetica-Bold', fontSize=9, textColor=header_fg))
h_reason = Paragraph('<b>Why / Exam Relevance</b>', ParagraphStyle('hdr', fontName='Helvetica-Bold', fontSize=9, textColor=header_fg))
table_data = [[h_sno, h_topic, h_reason]]
for sno, topic, reason in rows:
p_sno = Paragraph(str(sno), ParagraphStyle('cell', fontName='Helvetica-Bold', fontSize=9, textColor=colors.HexColor('#37474f'), alignment=TA_CENTER))
p_topic = Paragraph(topic, ParagraphStyle('cell', fontName='Helvetica-Bold', fontSize=9, textColor=colors.HexColor('#1a237e')))
p_reason = Paragraph(reason, ParagraphStyle('cell', fontName='Helvetica', fontSize=8.5, textColor=colors.HexColor('#424242')))
table_data.append([p_sno, p_topic, p_reason])
t = Table(table_data, colWidths=[0.7*cm, 7.5*cm, 9.2*cm])
style = [
('BACKGROUND', (0,0), (-1,0), header_bg),
('ROWBACKGROUNDS', (0,1), (-1,-1), [row_bg1, row_bg2]),
('BOX', (0,0), (-1,-1), 0.5, colors.HexColor('#cfd8dc')),
('INNERGRID', (0,0), (-1,-1), 0.3, colors.HexColor('#eceff1')),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('ALIGN', (0,0), (0,-1), 'CENTER'),
]
t.setStyle(TableStyle(style))
return t
def priority_badge(label, color):
data = [[Paragraph(f" {label} ", ParagraphStyle('badge', fontName='Helvetica-Bold', fontSize=9,
textColor=colors.white, alignment=TA_LEFT))]]
t = Table(data, colWidths=[4.5*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 6),
('ROUNDEDCORNERS', [4,4,4,4]),
]))
return t
# ===================== CONTENT =====================
story = []
# ---- TITLE PAGE HEADER ----
story.append(Spacer(1, 0.3*cm))
# Title box
title_data = [[
Paragraph("RUHS Microbiology - Theory Paper 2", title_style)
]]
title_table = Table(title_data, colWidths=[17.4*cm])
title_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#e8eaf6')),
('BOX', (0,0), (-1,-1), 1.5, colors.HexColor('#1a237e')),
('TOPPADDING', (0,0), (-1,-1), 12),
('BOTTOMPADDING', (0,0), (-1,-1), 12),
]))
story.append(title_table)
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("PRIORITY TOPIC LIST", ParagraphStyle('sub', fontName='Helvetica-Bold', fontSize=14,
textColor=colors.HexColor('#c62828'),
alignment=TA_CENTER)))
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("Based on RUHS Previous Year Papers (2022-2025) | NMC CBME Curriculum",
subtitle_style))
story.append(Paragraph("Rajasthan University of Health Sciences | II MBBS", note_style))
story.append(HRFlowable(width="100%", thickness=1.5, color=colors.HexColor('#1a237e')))
story.append(Spacer(1, 0.4*cm))
# ===================== UNIT 1 =====================
story.append(unit_header(1, "Gastrointestinal & Hepatobiliary System", "MI 4.1 - 4.9", 9, UNIT_COLORS[1]))
story.append(Spacer(1, 0.2*cm))
story.append(priority_badge("đ´ HIGH PRIORITY", colors.HexColor('#c62828')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(1, "Viral Hepatitis (A, B, C, D, E)\nViral markers, Lab diagnosis, Prevention",
"Long answer + MCQ dono mein consistently aata hai. Hepatitis B markers (HBsAg, anti-HBc, HBeAg) frequently asked."),
(2, "Enteric Fever / Typhoid\nSalmonella typhi - Widal test, Pathogenesis",
"Main question level topic. Widal test interpretation aur Typhidot test frequently asked."),
(3, "Cholera (Vibrio cholerae)\nPathogenesis, El Tor biotype, TCBS media, Toxin mechanism",
"Short note + MCQ - almost every RUHS exam. 'Rice water stools', Comma shaped bacilli = MCQ favourite."),
(4, "Amoebic Liver Abscess + Entamoeba histolytica\nTrophozoite vs Cyst, Lab diagnosis, Pathogenesis",
"Short note - directly asked in 2025 RUHS Paper II. Anchor-like flask shaped ulcer = important MCQ."),
(5, "Antibiotic-Associated Diarrhea / C. difficile\nPseudomembranous colitis, Toxin A&B",
"MCQ + Short note - 2025 paper mein direct MCQ (Pseudomembranous colitis caused by___)"),
(6, "Food Poisoning\nEnumerate causative agents (S. aureus, B. cereus, C. perfringens, Botulinum)",
"Standard short note. Shortest incubation = S. aureus (1-6 hrs) is common MCQ."),
], 'high'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĄ MEDIUM PRIORITY", colors.HexColor('#f57c00')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(7, "Shigella - Bacillary Dysentery\nPathogenesis, Lab diagnosis",
"Short note level. Shiga toxin mechanism important."),
(8, "Rotavirus + Viral Gastroenteritis\nMost common viral cause of gastroenteritis",
"Frequently asked as MCQ: 'Most common viral cause of diarrhea in children = Rotavirus'."),
(9, "H. pylori - Acid Peptic Disease\nDiagnosis (CLO test, Urea breath test), Treatment",
"Short note. Urease producing curved bacillus = MCQ key point."),
(10, "GI Parasites\nGiardia, Cryptosporidium, Ascaris, Hookworm, Tapeworm",
"Short note level. Cyst vs trophozoite differentiation important."),
], 'medium'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĸ LOW PRIORITY", colors.HexColor('#388e3c')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(11, "Non-typhoidal Salmonellae", "Short note. 2025 paper mein short note aaya tha."),
(12, "Halophilic Vibrios", "Short note. 2025 paper mein short note aaya."),
(13, "Liver Flukes / Echinococcus (Hydatid cyst)", "Occasional short note. Definitive host MCQ common."),
], 'low'))
story.append(PageBreak())
# ===================== UNIT 2 =====================
story.append(unit_header(2, "Musculoskeletal, Skin & Soft Tissue Infections", "MI 5.1 - 5.5", 5, UNIT_COLORS[2]))
story.append(Spacer(1, 0.2*cm))
story.append(priority_badge("đ´ HIGH PRIORITY", colors.HexColor('#c62828')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(1, "Tetanus - Clostridium tetani\nPathogenesis, Tetanospasmin toxin, Prevention, Treatment",
"Consistently asked. 2025 RUHS Paper II - direct short note: 'Pathogenesis of Tetanus'. Toxin mechanism = MCQ favourite."),
(2, "Staphylococcal Infections\nSSS Syndrome, Toxins (TSST-1, Exfoliatin), Food poisoning",
"2025 RUHS Paper II - 'Staphylococcal Scalded Skin Syndrome' direct short note. Coagulase test = MCQ."),
(3, "Leprosy - Mycobacterium leprae\nClassification (Tuberculoid vs Lepromatous), Lab diagnosis, Lepromin test",
"Long answer standard topic. WHO classification, MDT regimen important."),
(4, "Gas Gangrene / Anaerobic Infections\nClostridium perfringens, Nagler's reaction, Lecithinase",
"2025 paper mein 'Nagler's reaction' short note direct aaya. Lecithinase C = virulence factor MCQ."),
(5, "Dermatophytosis\nTrichophyton, Microsporum, Epidermophyton - Lab diagnosis, KOH prep",
"2025 RUHS Paper II - directly asked as short note. Wood's lamp = MCQ favourite."),
], 'high'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĄ MEDIUM PRIORITY", colors.HexColor('#f57c00')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(6, "Streptococcal Infections\nGABHS, Erysipelas, Impetigo, Necrotizing fasciitis",
"Short note. ASO titre, Dick test important MCQs."),
(7, "Anthrax - Bacillus anthracis\nCutaneous anthrax, Spore formation, Lab diagnosis",
"Short note. Medusa head colonies = MCQ key point."),
(8, "Subcutaneous Mycoses\nMycetoma, Chromoblastomycosis",
"Short note level. Madura foot = Mycetoma association = MCQ."),
(9, "Bone and Joint Infections\nCausative agents, S. aureus most common, Lab diagnosis",
"Short note. S. aureus = most common cause of osteomyelitis MCQ."),
], 'medium'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĸ LOW PRIORITY", colors.HexColor('#388e3c')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(10, "Nocardiosis", "Short note. Acid-fast branching filaments = MCQ."),
(11, "Non-venereal Treponematoses\nYaws, Pinta, Bejel", "Low priority. SDL topic."),
], 'low'))
story.append(PageBreak())
# ===================== UNIT 3 =====================
story.append(unit_header(3, "Central Nervous System Infections", "MI 6.1 - 6.3", 3, UNIT_COLORS[3]))
story.append(Spacer(1, 0.2*cm))
story.append(priority_badge("đ´ HIGH PRIORITY", colors.HexColor('#c62828')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(1, "Bacterial Meningitis\nN. meningitidis, S. pneumoniae, H. influenzae, CSF analysis",
"Classic long answer question - every RUHS exam. CSF analysis table (bacterial vs viral vs fungal) = most important."),
(2, "Cryptococcal Meningitis\nCryptococcus neoformans, India ink preparation, Capsule",
"2025 RUHS Paper II - direct short note. India ink = diagnostic test MCQ favourite."),
(3, "Rabies Virus\nPathogenesis, Negri bodies, PEP protocol, Vaccine types",
"Standard CNS viral topic. Negri bodies in Purkinje cells = classic MCQ. Bullet-shaped virus."),
(4, "Cerebral Malaria\nPlasmodium falciparum, Pathogenesis, Lab diagnosis",
"2025 RUHS Paper II - direct short note. P. falciparum = only species causing cerebral malaria."),
(5, "Poliomyelitis\nTypes (1,2,3), Lab diagnosis, OPV vs IPV, Eradication",
"Standard topic. Sabin (OPV) vs Salk (IPV) = classic MCQ."),
], 'high'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĄ MEDIUM PRIORITY", colors.HexColor('#f57c00')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(6, "Viral Encephalitis\nJapanese Encephalitis, Herpes Encephalitis",
"Short note. JE vector = Culex mosquito = MCQ."),
(7, "Brain Abscess\nCausative organisms, Anaerobes, Lab diagnosis",
"Short note level."),
(8, "Toxoplasma gondii\nCNS toxoplasmosis in HIV patients, Life cycle",
"Short note. Definitive host = cat = MCQ."),
], 'medium'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĸ LOW PRIORITY", colors.HexColor('#388e3c')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(9, "Prion Diseases / Slow Viral Diseases\nCJD, Kuru, Scrapie", "SDL topic. Low exam frequency."),
(10, "Naegleria fowleri\nPrimary amoebic meningoencephalitis", "Occasional MCQ. Swimming pool exposure = clue."),
], 'low'))
story.append(PageBreak())
# ===================== UNIT 4 =====================
story.append(unit_header(4, "Respiratory Tract Infections", "MI 7.1 - 7.5", 5, UNIT_COLORS[4]))
story.append(Spacer(1, 0.2*cm))
story.append(priority_badge("đ´ HIGH PRIORITY", colors.HexColor('#c62828')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(1, "Tuberculosis - M. tuberculosis\nPathogenesis, Lab diagnosis (ZN stain, Culture, CBNAAT/GeneXpert), RNTCP",
"MOST important respiratory topic. Main long answer level. Ghon's complex, Koch's phenomenon = MCQ favourites."),
(2, "Pneumococcal Pneumonia - S. pneumoniae\nLanceolate diplococci, Capsule, Virulence, Optochin sensitivity",
"2025 RUHS Paper II - Q3 was a full case question on lanceolate diplococci (Pneumococcus). Very high priority!"),
(3, "Atypical Pneumonia\nMycoplasma pneumoniae, Chlamydia, Legionella - Cold agglutinins, BCYE agar",
"2025 RUHS Paper II - direct short note: 'Atypical pneumonia'. Legionella + BCYE agar + AC = MCQ key."),
(4, "Influenza Virus\nTypes (A, B, C), Antigenic shift vs drift, Lab diagnosis, Pandemic",
"Short note + MCQ. Antigenic shift = pandemic (MCQ). Haemagglutinin & Neuraminidase important."),
(5, "COVID-19 - Lab Diagnosis\nRT-PCR, RAT, Serology, Specimen collection",
"2025 RUHS Paper II - direct short note: 'Lab Diagnosis of COVID-19 infection'. Current and exam-relevant."),
], 'high'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĄ MEDIUM PRIORITY", colors.HexColor('#f57c00')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(6, "Diphtheria - Corynebacterium diphtheriae\nGravis/Mitis/Intermedius, Schick test, Albert stain, Toxin",
"Short note. Pseudomembrane in throat = classic. Schick test = toxin susceptibility MCQ."),
(7, "Whooping Cough - Bordetella pertussis\nStages, Bordet-Gengou medium, Lab diagnosis",
"Short note. Cough-whoop-vomiting = 3 stages = MCQ."),
(8, "Respiratory Syncytial Virus (RSV)\nMost common cause of bronchiolitis in infants",
"Short note. Most common cause of bronchiolitis = RSV = MCQ."),
(9, "Specimen Collection - Respiratory Infections\nSputum, BAL, Throat swab - Transport, Processing",
"Practical/DOAP topic. Short note occasionally asked."),
], 'medium'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĸ LOW PRIORITY", colors.HexColor('#388e3c')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(10, "Atypical Mycobacteria (NTM)\nMAC, M. kansasii, M. fortuitum", "Short note. Seen in immunocompromised."),
(11, "Systemic Mycoses - Pulmonary\nCoccidioidomycosis, Histoplasmosis", "Low RUHS frequency. Occasional MCQ."),
], 'low'))
story.append(PageBreak())
# ===================== UNIT 5 =====================
story.append(unit_header(5, "Genitourinary & Sexually Transmitted Infections", "MI 8.1 - 8.4", 4, UNIT_COLORS[5]))
story.append(Spacer(1, 0.2*cm))
story.append(priority_badge("đ´ HIGH PRIORITY", colors.HexColor('#c62828')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(1, "UTI - Urinary Tract Infection\nCausative agents (E. coli #1), Predisposing factors, Pathogenesis, Lab diagnosis (Culture, Colony count)",
"2025 RUHS Paper II - Q6 MAIN LONG QUESTION on UTI! Most repeated topic across all RUHS exams. 10^5 CFU/mL = significant bacteriuria MCQ."),
(2, "Gonorrhoea - Neisseria gonorrhoeae\nGram -ve diplococci, Thayer-Martin medium, Pathogenesis, Complications (PID, Ophthalmia neonatorum)",
"Standard STI long/short note. Ophthalmia neonatorum prevention = important. Oxidase +ve MCQ."),
(3, "Syphilis - Treponema pallidum\nStages (Primary/Secondary/Tertiary), Serology (VDRL, TPHA, FTA-ABS)",
"Serology interpretation questions frequently asked. Biological false positive VDRL = important MCQ."),
(4, "Non-Gonococcal Urethritis (NGU)\nChlamydia trachomatis, Ureaplasma urealyticum, Lab diagnosis (NAAT)",
"2025 RUHS Paper II - direct short note: 'Non-Gonococcal Urethritis'. NAAT = gold standard for Chlamydia MCQ."),
], 'high'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĄ MEDIUM PRIORITY", colors.HexColor('#f57c00')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(5, "HIV / AIDS\nPathogenesis, CD4 count, Opportunistic infections, ART (NRTI, NNRTI, PI, INSTI)",
"Overlaps with Zoonotic/Misc section. Lab diagnosis (ELISA, Western Blot) = important. Window period MCQ."),
(6, "Herpes Genitalis - HSV-2\nPrimary vs recurrent infection, Lab diagnosis, Complications",
"Short note. Tzanck smear, Multinucleated giant cells = MCQ."),
(7, "Syndromic Management of STI\nWHO approach, Flow charts for urethral discharge, genital ulcer",
"SDL topic. RUHS occasionally asks this. Concept-based question."),
], 'medium'))
story.append(Spacer(1, 0.25*cm))
story.append(priority_badge("đĸ LOW PRIORITY", colors.HexColor('#388e3c')))
story.append(Spacer(1, 0.15*cm))
story.append(priority_table([
(8, "HPV - Human Papillomavirus\nGenital warts, Cervical cancer, Koilocytes, Vaccine",
"Occasional MCQ. Koilocytes = HPV cytopathic effect."),
(9, "Candidal Vaginitis\nCandida albicans, Germ tube test, KOH prep, Pseudohyphae",
"Germ tube test = C. albicans = classic MCQ."),
], 'low'))
story.append(PageBreak())
# ===================== TOP 10 SUMMARY =====================
story.append(Paragraph("TOP 10 MUST-PREPARE TOPICS", ParagraphStyle('top10hdr', fontName='Helvetica-Bold',
fontSize=14, textColor=colors.HexColor('#1a237e'),
alignment=TA_CENTER, spaceAfter=6)))
story.append(Paragraph("Based on RUHS 2022-2025 Pattern Analysis", ParagraphStyle('top10sub', fontName='Helvetica',
fontSize=10, textColor=colors.HexColor('#546e7a'),
alignment=TA_CENTER, spaceAfter=10)))
top10_data = [
[Paragraph('<b>Rank</b>', ParagraphStyle('h', fontName='Helvetica-Bold', fontSize=10, textColor=colors.white, alignment=TA_CENTER)),
Paragraph('<b>Topic</b>', ParagraphStyle('h', fontName='Helvetica-Bold', fontSize=10, textColor=colors.white)),
Paragraph('<b>Unit</b>', ParagraphStyle('h', fontName='Helvetica-Bold', fontSize=10, textColor=colors.white, alignment=TA_CENTER)),
Paragraph('<b>Frequency</b>', ParagraphStyle('h', fontName='Helvetica-Bold', fontSize=10, textColor=colors.white, alignment=TA_CENTER))],
["1", "UTI - Causative agents + Lab diagnosis", "Unit 5", "â
â
â
â
â
"],
["2", "Viral Hepatitis - Markers, Lab Diagnosis", "Unit 1", "â
â
â
â
â
"],
["3", "Tuberculosis - Pathogenesis + Lab Diagnosis", "Unit 4", "â
â
â
â
â
"],
["4", "Bacterial Meningitis - CSF analysis, organisms", "Unit 3", "â
â
â
â
"],
["5", "Pneumococcal Pneumonia (S. pneumoniae)", "Unit 4", "â
â
â
â
"],
["6", "Tetanus - Pathogenesis, Toxin mechanism", "Unit 2", "â
â
â
â
"],
["7", "Typhoid / Enteric Fever - Widal test", "Unit 1", "â
â
â
â
"],
["8", "Gonorrhoea + Syphilis (Serology)", "Unit 5", "â
â
â
â
"],
["9", "Cholera - Toxin, Media, El Tor biotype", "Unit 1", "â
â
â
"],
["10", "Rabies + Cryptococcal Meningitis", "Unit 3", "â
â
â
"],
]
top10_col_styles = [1.2*cm, 9.8*cm, 2.5*cm, 3.9*cm]
top10_table = Table(top10_data, colWidths=top10_col_styles)
top10_style = TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a237e')),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#e8eaf6'), colors.white]),
('BOX', (0,0), (-1,-1), 0.8, colors.HexColor('#9fa8da')),
('INNERGRID', (0,0), (-1,-1), 0.3, colors.HexColor('#c5cae9')),
('TOPPADDING', (0,0), (-1,-1), 7),
('BOTTOMPADDING', (0,0), (-1,-1), 7),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('ALIGN', (0,0), (0,-1), 'CENTER'),
('ALIGN', (2,0), (3,-1), 'CENTER'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,1), (-1,-1), 9.5),
('TEXTCOLOR', (0,1), (-1,-1), colors.HexColor('#212121')),
('FONTNAME', (0,1), (0,-1), 'Helvetica-Bold'),
('TEXTCOLOR', (0,1), (0,-1), colors.HexColor('#c62828')),
])
top10_table.setStyle(top10_style)
story.append(top10_table)
story.append(Spacer(1, 1*cm))
story.append(HRFlowable(width="100%", thickness=0.8, color=colors.HexColor('#9fa8da')))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Source: RUHS II MBBS Microbiology Paper-II (July-August 2025, December 2022, January 2022) | "
"NMC CBME Curriculum 2019 | Priority based on topic frequency analysis",
footer_style
))
story.append(Paragraph(
"Prepared for RUHS-affiliated Medical Colleges | For exam preparation use only",
footer_style
))
# BUILD
doc.build(story)
print("PDF generated successfully:", OUTPUT)