Can you give me more easy classification of pharmacology drugs which is easy to remember
| Letter | Class | Examples |
|---|---|---|
| A | ACE Inhibitors / ARBs | Enalapril, Losartan |
| B | Beta-blockers | Metoprolol, Atenolol |
| C | Calcium Channel Blockers | Amlodipine, Nifedipine, Verapamil |
| D | Diuretics | Hydrochlorothiazide, Furosemide |
Memory tip: "ABCDs of BP" - Start with A for most patients, D for Blacks/elderly.
| Class | Mechanism | Drugs | Hook |
|---|---|---|---|
| Ia | Na+ channel block (slow) | Quinidine, Procainamide | "Queen Proclaims" |
| Ib | Na+ channel block (fast) | Lidocaine, Mexiletine | Post-MI use |
| Ic | Na+ channel block (slow-in, slow-out) | Flecainide, Propafenone | Avoid in structural heart disease |
| II | Beta-blockers | Metoprolol, Esmolol | Slow the node |
| III | K+ channel block | Amiodarone, Sotalol | "Am I Sore?" |
| IV | Ca2+ channel block | Verapamil, Diltiazem | SVT |
Memory tip: "Some Blocks Kill All Arrhythmias" = Na+, Beta, K+, All = Ca2+
| Drug | Benefit |
|---|---|
| ACE inhibitors/ARBs | Reduce mortality |
| Beta-blockers (carvedilol, metoprolol) | Reduce mortality |
| Carbinol (Sacubitril/Valsartan - ARNI) | Best new agent |
| Diuretics | Symptom relief only |
| Digoxin | Symptom relief, rate control |
| Spironolactone | Reduce mortality (add-on) |
| Drug | Target |
|---|---|
| Statins | LDL (main drug) |
| Fibrates | TG |
| Fish oil (Omega-3) | TG |
| Niacin | LDL + TG, raises HDL |
| Ezetimibe | LDL (blocks absorption) |
| Evolucomab (PCSK9i) | LDL (injectable) |
| Class | Examples | Mechanism |
|---|---|---|
| SSRI | Fluoxetine, Sertraline, Citalopram | 5-HT reuptake block |
| SNRI | Venlafaxine, Duloxetine | 5-HT + NE reuptake block |
| MAO Inhibitor | Phenelzine, Tranylcypromine | MAO inhibition - watch tyramine! |
| Atypical | Mirtazapine, Bupropion, Trazodone | Mixed mechanisms |
| Rycyclic (Tri) | Amitriptyline, Imipramine, Clomipramine | NE + 5-HT + anticholinergic |
Memory tip: SSRIs are first-line. TCAs used for OCD (clomipramine), bedwetting (imipramine), neuropathic pain.
| Drug | Special Feature |
|---|---|
| Clozapine | Best for refractory; agranulocytosis risk - CBC monitoring |
| Olanzapine | Weight gain, metabolic syndrome |
| Risperidone | Most EPS among atypicals |
| Quetiapine | Safest in Parkinson's/DLB |
| Aripiprazole | Partial D2 agonist - least metabolic side effects |
| Ziprasidone | QT prolongation |
Memory tip: "CORQAZ" = Clozapine, Olanzapine, Risperidone, Quetiapine, Aripiprazole, Ziprasidone
| Drug Class | Examples | Key Point |
|---|---|---|
| Benzodiazepines | Diazepam, Lorazepam, Midazolam | GABA-A - risk of dependence |
| Buspirone | Buspirone | 5-HT1A agonist - no dependence, delayed onset |
| Z-drugs | Zolpidem, Zaleplon | Sleep only; less dependence |
| Beta-blockers | Propranolol | Situational anxiety (tremor) |
Short-acting benzos for sleep (LETMiN): Lorazepam, Estazolam, Temazepam, Midazolam
| Seizure Type | First-Line Drug |
|---|---|
| Generalized tonic-clonic | Valproate, Phenytoin, Carbamazepine |
| Absence | Ethosuximide (or Valproate) |
| Partial/Focal | Carbamazepine, Levetiracetam |
| Status epilepticus | Lorazepam → Fosphenytoin → Phenobarbital |
| Myoclonic | Valproate, Levetiracetam |
Memory: "VPA does everything" - Valproate is broad-spectrum but teratogenic (avoid in pregnancy).
| Drug | Mechanism |
|---|---|
| Amantadine | NMDA antagonist, increases DA release |
| Carbidopa/Levodopa | DA precursor (carbidopa prevents peripheral conversion) |
| Dopamine agonists | Ropinirole, Pramipexole (young patients) |
| Selegiline | MAO-B inhibitor (neuroprotective?) |
| + COMT inhibitors | Entacapone, Tolcapone (prolong levodopa effect) |
| + Anticholinergics | Trihexyphenidyl (for tremor only) |
| Class | Key Drugs | Coverage |
|---|---|---|
| Penicillins | Amoxicillin, Piperacillin | Gram +/- |
| Lincosamides | Clindamycin | Gram+, anaerobes |
| Aminoglycosides | Gentamicin, Amikacin | Gram- (aerobic) |
| Tetracyclines | Doxycycline, Minocycline | Atypicals, Rickettsia |
| Erythromycin (Macrolides) | Azithromycin, Clarithromycin | Atypicals, Strep |
| Sulfonamides | TMP-SMX | UTI, PCP |
| Metronidazole | Metronidazole | Anaerobes, protozoa |
| Vancomycin | Vancomycin | MRSA, C. diff (oral) |
| Carbapenems | Meropenem, Imipenem | Broadest spectrum |
Gram (+) cocci (Staph/Strep): Penicillins, Cephalosporins, Vancomycin
Gram (-) rods (E. coli, Klebsiella): Aminoglycosides, Fluoroquinolones, Cephalosporins 3rd/4th
Atypicals (Mycoplasma, Legionella, Chlamydia): Macrolides, Doxycycline, Fluoroquinolones
Anaerobes (below diaphragm): Metronidazole, Clindamycin, Piperacillin-tazobactam
Pseudomonas: Pip-Tazo, Cefepime, Meropenem, Ciprofloxacin, Aminoglycosides
| Generation | Coverage Hook | Key Drugs |
|---|---|---|
| 1st | "Gram + king" | Cefazolin (surgical prophylaxis) |
| 2nd | "H. flu added" | Cefuroxime, Cefoxitin (anaerobes) |
| 3rd | "Gram - power" | Ceftriaxone (meningitis, gonorrhea), Cefotaxime |
| 4th | "Pseudo added" | Cefepime |
| 5th | "MRSA buster" | Ceftaroline |
Each generation gains Gram(-) coverage but loses some Gram(+).
| Drug | Classic Side Effect |
|---|---|
| Aminoglycosides | Nephrotoxicity + Ototoxicity |
| Vancomycin | "Red Man Syndrome" (infusion), nephrotoxicity |
| Metronidazole | Metallic taste, disulfiram-like reaction with alcohol |
| Fluoroquinolones | Tendon rupture, QT prolongation, avoid in kids |
| Tetracyclines | Photosensitivity, avoid in pregnancy/children |
| Chloramphenicol | "Gray baby syndrome," aplastic anemia |
| Clindamycin | C. difficile colitis |
| Rifampin | Orange urine/secretions, major CYP450 inducer |
| Mnemonic | Meaning |
|---|---|
| ABCDs of HTN | ACEi, Beta-blocker, CCB, Diuretic |
| CORQAZ | Atypical antipsychotics |
| PLATES + MVC | Antibiotic classes |
| 1-2-3-4-5 Ceph | Cephalosporin generations |
| VPA does everything | Valproate is broad-spectrum AED |
| SMART antidepressants | SSRI, SNRI, MAOI, Atypical, TCA |
Create a printable PDF study guide of this drug classification
mkdir -p /tmp/workspace/pharma-guide && ls /tmp/workspace/
~/pharma-guide/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 mm, cm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import Flowable
# ── Colour palette ────────────────────────────────────────────────────────────
C_DARK_BLUE = colors.HexColor("#1A3A5C")
C_MED_BLUE = colors.HexColor("#2E6DA4")
C_LIGHT_BLUE = colors.HexColor("#D6E8F7")
C_TEAL = colors.HexColor("#0D7377")
C_LIGHT_TEAL = colors.HexColor("#C8ECED")
C_GREEN = colors.HexColor("#1B7A3E")
C_LIGHT_GREEN = colors.HexColor("#D4EDDA")
C_ORANGE = colors.HexColor("#C0510E")
C_LIGHT_ORANGE= colors.HexColor("#FDEBD0")
C_PURPLE = colors.HexColor("#5B2C8A")
C_LIGHT_PURPLE= colors.HexColor("#EDE0F5")
C_RED = colors.HexColor("#B71C1C")
C_LIGHT_RED = colors.HexColor("#FDECEA")
C_YELLOW = colors.HexColor("#F5C518")
C_LIGHT_YELLOW= colors.HexColor("#FFF9E6")
C_GRAY = colors.HexColor("#F4F6F9")
C_DARK_GRAY = colors.HexColor("#444444")
C_WHITE = colors.white
# ── Document setup ────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
"/tmp/workspace/pharma-guide/Pharmacology_Drug_Classification.pdf",
pagesize=A4,
rightMargin=15*mm, leftMargin=15*mm,
topMargin=18*mm, bottomMargin=18*mm,
title="Pharmacology Drug Classification - Easy Memory Guide",
author="Medical Study Guide"
)
W = A4[0] - 30*mm # usable width
styles = getSampleStyleSheet()
# ── Custom styles ─────────────────────────────────────────────────────────────
def S(name, **kw):
return ParagraphStyle(name, **kw)
sTitle = S("sTitle",
fontName="Helvetica-Bold", fontSize=22, textColor=C_WHITE,
alignment=TA_CENTER, spaceAfter=4)
sSub = S("sSub",
fontName="Helvetica", fontSize=11, textColor=C_LIGHT_BLUE,
alignment=TA_CENTER, spaceAfter=2)
sH1 = S("sH1",
fontName="Helvetica-Bold", fontSize=14, textColor=C_WHITE,
spaceAfter=4, spaceBefore=8, leftIndent=6)
sH2 = S("sH2",
fontName="Helvetica-Bold", fontSize=11, textColor=C_DARK_BLUE,
spaceAfter=3, spaceBefore=6)
sBody = S("sBody",
fontName="Helvetica", fontSize=8.5, textColor=C_DARK_GRAY,
spaceAfter=2, leading=12)
sTip = S("sTip",
fontName="Helvetica-BoldOblique", fontSize=8.2, textColor=C_GREEN,
spaceAfter=3, spaceBefore=2, leftIndent=6)
sSmall = S("sSmall",
fontName="Helvetica", fontSize=7.8, textColor=C_DARK_GRAY,
leading=11)
sBullet = S("sBullet",
fontName="Helvetica", fontSize=8.5, textColor=C_DARK_GRAY,
leftIndent=12, spaceAfter=1, leading=12, bulletIndent=4)
sCode = S("sCode",
fontName="Courier", fontSize=8, textColor=C_DARK_BLUE,
leftIndent=10, spaceAfter=1, leading=11)
# ── Helpers ───────────────────────────────────────────────────────────────────
def section_banner(text, bg=C_MED_BLUE):
"""Coloured full-width section banner."""
data = [[Paragraph(text, sH1)]]
t = Table(data, colWidths=[W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("ROUNDEDCORNERS", [4]),
]))
return t
def tip_box(text, bg=C_LIGHT_GREEN, border=C_GREEN):
data = [[Paragraph("💡 " + text, sTip)]]
t = Table(data, colWidths=[W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("LINEBELOW", (0,0), (-1,-1), 1.2, border),
("LINEBEFORE", (0,0), (-1,-1), 3, border),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 8),
]))
return t
def make_table(headers, rows, col_widths, hdr_bg=C_DARK_BLUE, hdr_fg=C_WHITE,
alt_bg=C_GRAY, border=C_MED_BLUE):
hdr_cells = [Paragraph(f"<b>{h}</b>", S("th",
fontName="Helvetica-Bold", fontSize=8.5, textColor=hdr_fg,
alignment=TA_CENTER, leading=11)) for h in headers]
data = [hdr_cells]
for i, row in enumerate(rows):
cells = [Paragraph(str(c), sSmall) for c in row]
data.append(cells)
t = Table(data, colWidths=col_widths, repeatRows=1)
style_cmds = [
("BACKGROUND", (0,0), (-1,0), hdr_bg),
("GRID", (0,0), (-1,-1), 0.4, border),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("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, alt_bg]),
]
t.setStyle(TableStyle(style_cmds))
return t
def sp(n=4):
return Spacer(1, n)
# ── Build story ───────────────────────────────────────────────────────────────
story = []
# ═══════════════════════════════════════════════════════════════════════════════
# COVER HEADER
# ═══════════════════════════════════════════════════════════════════════════════
cover_title = [[Paragraph("PHARMACOLOGY", sTitle),
Paragraph("Drug Classification - Easy Memory Guide", sSub),
Paragraph("MBBS/MD | USMLE/NEET Preparation | 2026", sSub)]]
ct = Table(cover_title, colWidths=[W])
ct.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), C_DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 14),
("BOTTOMPADDING", (0,0), (-1,-1), 14),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("ROUNDEDCORNERS", [6]),
]))
story.append(ct)
story.append(sp(8))
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 1: CARDIOVASCULAR DRUGS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("1. CARDIOVASCULAR DRUGS", C_MED_BLUE))
story.append(sp(6))
# 1A – ABCDs of HTN
story.append(Paragraph("A. Antihypertensives – The 'ABCD' Rule", sH2))
story.append(tip_box("ABCDs of BP: ACE Inhibitors, Beta-blockers, CCBs, Diuretics. "
"Start with A for most patients; D preferred for Black/elderly patients."))
story.append(sp(4))
story.append(make_table(
["Letter", "Class", "Key Drugs"],
[
["A", "ACE Inhibitors / ARBs", "Enalapril, Lisinopril, Losartan, Valsartan"],
["B", "Beta-blockers", "Metoprolol, Atenolol, Bisoprolol, Carvedilol"],
["C", "Calcium Channel Blockers (CCBs)", "Amlodipine, Nifedipine, Verapamil, Diltiazem"],
["D", "Diuretics", "Hydrochlorothiazide (HCTZ), Furosemide, Chlorthalidone"],
],
[W*0.08, W*0.42, W*0.50],
hdr_bg=C_MED_BLUE
))
story.append(sp(8))
# 1B – Antiarrhythmics
story.append(Paragraph("B. Antiarrhythmics – Vaughan Williams Classification", sH2))
story.append(tip_box('Mnemonic: "Some Blocks Kill All Arrhythmias" = Na+ block, Beta block, K+ block, All (Ca2+) block'))
story.append(sp(4))
story.append(make_table(
["Class", "Mechanism", "Key Drugs", "Clinical Use"],
[
["Ia", "Na+ block (↑APD)", "Quinidine, Procainamide\n\"Queen Proclaims\"", "AF, VT (caution)"],
["Ib", "Na+ block (↓APD)", "Lidocaine, Mexiletine", "Post-MI VT"],
["Ic", "Na+ block (no APD change)", "Flecainide, Propafenone", "Avoid structural heart disease"],
["II", "Beta-blockade", "Metoprolol, Esmolol, Propranolol", "SVT, rate control"],
["III", "K+ block (↑APD)", "Amiodarone, Sotalol\n\"Am I Sore?\"", "AF, VF, VT"],
["IV", "Ca2+ block", "Verapamil, Diltiazem", "SVT, rate control"],
],
[W*0.08, W*0.28, W*0.34, W*0.30],
hdr_bg=C_TEAL, alt_bg=C_LIGHT_TEAL
))
story.append(sp(8))
# 1C – Heart Failure
story.append(Paragraph("C. Heart Failure Drugs", sH2))
story.append(make_table(
["Drug Class", "Examples", "Benefit"],
[
["ACE Inhibitors / ARBs", "Enalapril, Lisinopril, Losartan", "Reduce mortality ✔"],
["Beta-blockers", "Carvedilol, Metoprolol succinate, Bisoprolol", "Reduce mortality ✔"],
["ARNI (Sacubitril/Valsartan)", "Entresto", "Best new agent – reduce mortality ✔"],
["Diuretics", "Furosemide, HCTZ, Spironolactone", "Symptom relief; Spirono → mortality ↓"],
["Digoxin", "Digoxin", "Symptom relief + rate control (AF)"],
["SGLT2 Inhibitors", "Empagliflozin, Dapagliflozin", "Reduce hospitalisation + mortality ✔"],
],
[W*0.30, W*0.40, W*0.30],
hdr_bg=C_MED_BLUE
))
story.append(sp(8))
# 1D – Lipid-lowering
story.append(Paragraph("D. Lipid-Lowering Drugs – Mnemonic: 'SFF-NEE'", sH2))
story.append(make_table(
["Letter", "Class", "Examples", "Primary Target"],
[
["S", "Statins (HMG-CoA reductase inhibitors)", "Atorvastatin, Rosuvastatin, Simvastatin", "↓ LDL (1st line)"],
["F", "Fibrates", "Fenofibrate, Gemfibrozil", "↓ TG"],
["F", "Fish Oil (Omega-3)", "Icosapent ethyl (Vascepa)", "↓ TG"],
["N", "Niacin", "Niacin (nicotinic acid)", "↓ LDL & TG, ↑ HDL"],
["E", "Ezetimibe", "Ezetimibe", "↓ LDL (blocks absorption)"],
["E", "PCSK9 Inhibitors", "Evolocumab, Alirocumab (injectable)", "↓ LDL (severe hypercholesterolaemia)"],
],
[W*0.07, W*0.32, W*0.33, W*0.28],
hdr_bg=C_MED_BLUE
))
story.append(sp(6))
story.append(tip_box("Statins are 1st line for all patients with cardiovascular risk. Add Ezetimibe if LDL not at goal. "
"PCSK9i for FH or very high-risk patients."))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 2: CNS / PSYCHIATRIC DRUGS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("2. CNS / PSYCHIATRIC DRUGS", C_PURPLE))
story.append(sp(6))
# 2A – Antidepressants
story.append(Paragraph("A. Antidepressants – Mnemonic: 'SMART'", sH2))
story.append(tip_box("SSRIs are ALWAYS first-line. TCAs used for neuropathic pain, OCD (Clomipramine), bedwetting (Imipramine)."))
story.append(sp(4))
story.append(make_table(
["Letter", "Class", "Examples", "Key Feature"],
[
["S", "SSRI", "Fluoxetine, Sertraline, Citalopram, Escitalopram, Paroxetine", "5-HT reuptake block; 1st line"],
["S", "SNRI", "Venlafaxine, Duloxetine, Desvenlafaxine", "5-HT + NE reuptake block; pain too"],
["M", "MAO Inhibitors", "Phenelzine, Tranylcypromine (irreversible)\nMoclobemide (reversible)", "⚠ Tyramine reaction – avoid aged cheese, wine"],
["A", "Atypical", "Mirtazapine (↑appetite), Bupropion (no sexual SE), Trazodone (sleep)", "Mixed/unique mechanisms"],
["R", "TCA (Tricyclic)", "Amitriptyline, Imipramine, Clomipramine, Nortriptyline", "NE+5-HT+anticholinergic; toxic in OD"],
],
[W*0.06, W*0.18, W*0.40, W*0.36],
hdr_bg=C_PURPLE, alt_bg=C_LIGHT_PURPLE
))
story.append(sp(8))
# 2B – Antipsychotics
story.append(Paragraph("B. Antipsychotics", sH2))
story.append(Paragraph("<b>Typical (1st generation) – D2 Blockade</b>", sBody))
story.append(sp(2))
story.append(make_table(
["Potency", "Drugs", "Side Effect Profile"],
[
["High potency", "Haloperidol, Fluphenazine, Trifluoperazine", "High EPS risk (Parkinsonism, Akathisia, Tardive dyskinesia)"],
["Low potency", "Chlorpromazine, Thioridazine", "More sedation, anticholinergic, hypotension; Thioridazine → retinal pigmentation"],
],
[W*0.20, W*0.40, W*0.40],
hdr_bg=C_DARK_GRAY
))
story.append(sp(5))
story.append(Paragraph('<b>Atypical (2nd generation) – Mnemonic: "CORQAZ"</b>', sBody))
story.append(sp(2))
story.append(make_table(
["Drug", "Special Feature / Indication"],
[
["Clozapine (C)", "Best for refractory schizophrenia – MONITOR CBC (agranulocytosis risk)"],
["Olanzapine (O)", "Weight gain + metabolic syndrome – avoid in diabetics"],
["Risperidone (R)", "Most EPS among atypicals; prolactin elevation"],
["Quetiapine (Q)", "Safest in Parkinson's psychosis / Dementia with Lewy bodies"],
["Aripiprazole (A)", "Partial D2 agonist – least metabolic SE; good for bipolar adjunct"],
["Ziprasidone (Z)", "QT prolongation – check ECG; take with food"],
],
[W*0.28, W*0.72],
hdr_bg=C_PURPLE, alt_bg=C_LIGHT_PURPLE
))
story.append(sp(6))
story.append(tip_box("Neuroleptic Malignant Syndrome (NMS): hyperthermia, rigidity, altered consciousness, ↑CK. "
"Stop antipsychotic immediately. Treat with Dantrolene + Bromocriptine."))
story.append(sp(8))
# 2C – Anxiolytics
story.append(Paragraph("C. Anxiolytics / Sedatives", sH2))
story.append(make_table(
["Class", "Examples", "Mechanism", "Key Points"],
[
["Benzodiazepines", "Diazepam, Lorazepam, Midazolam, Alprazolam", "GABA-A ↑ (Cl- influx)", "Dependence risk; reverse with Flumazenil"],
["Buspirone", "Buspirone", "5-HT1A partial agonist", "No dependence; 2-week onset; GAD first-line"],
["Z-drugs", "Zolpidem, Zaleplon, Eszopiclone", "GABA-A (BZ binding site)", "Sleep only; less dependence than BZDs"],
["Beta-blockers", "Propranolol", "β-blockade → ↓ HR, tremor", "Situational/performance anxiety"],
["SSRIs/SNRIs", "Escitalopram, Venlafaxine", "5-HT ± NE reuptake block", "Long-term GAD/Panic/PTSD/OCD treatment"],
],
[W*0.18, W*0.26, W*0.25, W*0.31],
hdr_bg=C_PURPLE, alt_bg=C_LIGHT_PURPLE
))
story.append(sp(4))
story.append(tip_box('Short-acting BZDs for sleep – "LETMiN": Lorazepam, Estazolam, Temazepam, Midazolam, triazolam(N).'))
story.append(sp(8))
# 2D – Antiepileptics
story.append(Paragraph("D. Antiepileptics – by Seizure Type", sH2))
story.append(make_table(
["Seizure Type", "First-Line Drug(s)", "Notes"],
[
["Generalized tonic-clonic (GTC)", "Valproate, Levetiracetam, Lamotrigine", "VPA broad-spectrum but teratogenic"],
["Absence (petit mal)", "Ethosuximide (1st line), Valproate", "Ethosuximide: pure absence only"],
["Focal / Partial seizures", "Carbamazepine, Levetiracetam, Oxcarbazepine", "Carbamazepine: strong CYP inducer"],
["Myoclonic", "Valproate, Levetiracetam, Clonazepam", "Avoid Carbamazepine (worsens myoclonus)"],
["Status epilepticus", "Lorazepam IV → Fosphenytoin → Phenobarbital → Propofol", "ABCs + thiamine first"],
["Trigeminal neuralgia", "Carbamazepine (1st line)", "Not a seizure but uses AED"],
],
[W*0.28, W*0.40, W*0.32],
hdr_bg=C_TEAL, alt_bg=C_LIGHT_TEAL
))
story.append(sp(4))
story.append(tip_box('"VPA does everything" – Valproate is broad-spectrum (GTC, Absence, Myoclonic, Bipolar, Migraine prophylaxis) '
'BUT teratogenic (spina bifida). Avoid in women of childbearing age.'))
story.append(sp(8))
# 2E – Parkinson's
story.append(Paragraph("E. Parkinson's Disease Drugs – Mnemonic: 'ACDS + COMT'", sH2))
story.append(make_table(
["Drug / Class", "Examples", "Mechanism", "Notes"],
[
["A – Amantadine", "Amantadine", "NMDA antagonist; ↑DA release", "Also treats drug-induced dyskinesias"],
["C – Carbidopa/Levodopa","Sinemet (Carbidopa + Levodopa)","DA precursor; Carbidopa prevents peripheral conversion","Gold standard; motor fluctuations with long use"],
["D – DA Agonists", "Ropinirole, Pramipexole, Rotigotine","Direct D2/D3 agonist", "Younger patients; compulsive behaviour SE"],
["S – Selegiline", "Selegiline, Rasagiline", "MAO-B inhibitor → ↑DA", "Mild disease; possibly neuroprotective"],
["COMT inhibitors", "Entacapone, Tolcapone", "Block COMT → prolong levodopa effect", "Tolcapone: hepatotoxicity – monitor LFTs"],
["Anticholinergics", "Trihexyphenidyl, Benztropine","Block muscarinic receptors", "Tremor only; avoid in elderly (confusion)"],
],
[W*0.20, W*0.24, W*0.28, W*0.28],
hdr_bg=C_TEAL, alt_bg=C_LIGHT_TEAL
))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 3: ANTIBIOTICS / ANTI-INFECTIVES
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("3. ANTIBIOTICS / ANTI-INFECTIVES", C_GREEN))
story.append(sp(6))
# 3A – Classes overview
story.append(Paragraph("A. Antibiotic Classes – Mnemonic: 'PLATES + MVC'", sH2))
story.append(make_table(
["Letter", "Class", "Key Drugs", "Primary Coverage"],
[
["P", "Penicillins", "Amoxicillin, Ampicillin, Nafcillin, Pip-Tazobactam", "Gram+/- (broad with pip-tazo)"],
["L", "Lincosamides", "Clindamycin", "Gram+, Anaerobes (above & below diaphragm)"],
["A", "Aminoglycosides", "Gentamicin, Amikacin, Tobramycin", "Aerobic Gram- rods (synergy with cell-wall agents)"],
["T", "Tetracyclines", "Doxycycline, Minocycline, Tigecycline", "Atypicals, Rickettsia, Brucella, Chlamydia"],
["E", "Macrolides", "Azithromycin, Clarithromycin, Erythromycin", "Atypicals, Strep, H. pylori (clarithro)"],
["S", "Sulfonamides/TMP-SMX", "Trimethoprim-Sulfamethoxazole", "UTI, PCP, Nocardia, community MRSA"],
["M", "Metronidazole", "Metronidazole (Flagyl)", "Anaerobes, C. diff (oral), Protozoa (Giardia, Trichomonas)"],
["V", "Vancomycin", "Vancomycin", "MRSA, C. diff (oral), Gram+ only"],
["C", "Carbapenems", "Meropenem, Imipenem, Ertapenem", "Broadest spectrum; covers ESBL, anaerobes"],
],
[W*0.06, W*0.22, W*0.34, W*0.38],
hdr_bg=C_GREEN, alt_bg=C_LIGHT_GREEN
))
story.append(sp(8))
# 3B – Coverage cheat sheet
story.append(Paragraph("B. Coverage Cheat Sheet", sH2))
cov_data = [
[Paragraph("<b>Organism / Scenario</b>", S("h", fontName="Helvetica-Bold", fontSize=8.5, textColor=C_WHITE, alignment=TA_CENTER)),
Paragraph("<b>Go-to Antibiotic(s)</b>", S("h", fontName="Helvetica-Bold", fontSize=8.5, textColor=C_WHITE, alignment=TA_CENTER))],
["Gram+ cocci (MSSA)", "Nafcillin/Oxacillin; Cefazolin (surgical prophylaxis)"],
["Gram+ cocci (MRSA)", "Vancomycin (IV), Linezolid (oral), Daptomycin, TMP-SMX (CA-MRSA)"],
["Gram- rods (E. coli, Klebsiella)", "Cephalosporins 3rd/4th gen, Fluoroquinolones, Aminoglycosides"],
["Pseudomonas aeruginosa", "Pip-Tazo, Cefepime (4th), Meropenem, Ciprofloxacin, Aminoglycosides"],
["Atypicals (Mycoplasma, Legionella, Chlamydia)", "Azithromycin, Doxycycline, Fluoroquinolones (levofloxacin)"],
["Anaerobes – above diaphragm", "Clindamycin, Amoxicillin-clavulanate"],
["Anaerobes – below diaphragm", "Metronidazole, Pip-Tazo, Meropenem"],
["C. difficile", "Vancomycin PO (1st line) or Fidaxomicin; Metronidazole (mild only)"],
["Meningitis (community)", "Ceftriaxone + Vancomycin (+ Ampicillin if >50 yrs for Listeria)"],
["PCP (Pneumocystis jirovecii)", "TMP-SMX (+ steroids if PaO2 <70 mmHg)"],
]
cov_t = Table(cov_data, colWidths=[W*0.42, W*0.58])
cov_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), C_GREEN),
("GRID", (0,0), (-1,-1), 0.4, C_GREEN),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_LIGHT_GREEN]),
("FONTNAME", (0,1), (-1,-1), "Helvetica"),
("FONTSIZE", (0,1), (-1,-1), 8.2),
]))
story.append(cov_t)
story.append(sp(8))
# 3C – Cephalosporins by generation
story.append(Paragraph("C. Cephalosporins by Generation", sH2))
story.append(tip_box("Each generation ↑ Gram(-) coverage but ↓ Gram(+) activity. "
"5th gen (Ceftaroline) is the only cephalosporin active against MRSA."))
story.append(sp(4))
story.append(make_table(
["Generation", "Memory Hook", "Key Drugs", "Clinical Use"],
[
["1st", "Gram+ King", "Cefazolin (IV), Cephalexin (PO)", "Surgical prophylaxis, skin/soft tissue"],
["2nd", "H. flu added + anaerobes", "Cefuroxime, Cefoxitin, Cefotetan", "Respiratory, pelvic infections"],
["3rd", "Gram- power", "Ceftriaxone, Cefotaxime, Ceftazidime*", "Meningitis, gonorrhoea, sepsis (*Pseudomonas)"],
["4th", "Pseudomonas added", "Cefepime", "Severe Gram- / febrile neutropenia"],
["5th", "MRSA buster", "Ceftaroline", "MRSA skin infections, CAP"],
],
[W*0.13, W*0.27, W*0.30, W*0.30],
hdr_bg=C_GREEN, alt_bg=C_LIGHT_GREEN
))
story.append(sp(8))
# 3D – Side effects
story.append(Paragraph("D. Key Antibiotic Side Effects – Must Know!", sH2))
story.append(make_table(
["Drug", "Classic Side Effect / Toxicity"],
[
["Aminoglycosides (Gentamicin, Amikacin)", "Nephrotoxicity + Ototoxicity (monitor levels)"],
["Vancomycin", '"Red Man Syndrome" (slow infusion rate) + Nephrotoxicity (with aminoglycosides)'],
["Metronidazole", "Metallic taste; disulfiram-like reaction with alcohol; peripheral neuropathy"],
["Fluoroquinolones", "Tendon rupture (Achilles), QT prolongation, avoid in children/pregnancy"],
["Tetracyclines", "Photosensitivity, teeth discolouration (children), avoid in pregnancy"],
["Chloramphenicol", '"Gray Baby Syndrome" (neonates); aplastic anemia'],
["Clindamycin", "C. difficile pseudomembranous colitis (highest risk)"],
["Rifampin", "Orange urine/sweat/tears; potent CYP450 inducer (many drug interactions)"],
["Isoniazid (INH)", "Peripheral neuropathy (give B6/pyridoxine), hepatotoxicity, lupus-like"],
["Sulfonamides (TMP-SMX)", "Stevens-Johnson syndrome, kernicterus (neonates), folate deficiency"],
],
[W*0.40, W*0.60],
hdr_bg=C_RED, alt_bg=C_LIGHT_RED
))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 4: QUICK MNEMONICS SUMMARY PAGE
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("4. QUICK MNEMONICS SUMMARY", C_ORANGE))
story.append(sp(6))
story.append(make_table(
["Mnemonic", "Meaning", "Category"],
[
["ABCDs of BP", "ACE Inhibitors → Beta-blockers → CCBs → Diuretics", "Antihypertensives"],
["Some Blocks Kill All", "Na+ / Beta / K+ / Ca2+ channel blockers", "Antiarrhythmics"],
["SMART", "SSRI → SNRI → MAOI → Atypical → TCA (Tricyclic)", "Antidepressants"],
["CORQAZ", "Clozapine, Olanzapine, Risperidone, Quetiapine, Aripiprazole, Ziprasidone", "Atypical Antipsychotics"],
["LETMiN", "Lorazepam, Estazolam, Temazepam, Midazolam, triazolam(N) – short-acting BZDs", "Anxiolytics / Sleep"],
["VPA does everything", "Valproate = GTC + Absence + Myoclonic + Bipolar + Migraine prophylaxis", "Antiepileptics"],
["ACDS + COMT", "Amantadine → Carbidopa/Levodopa → DA Agonists → Selegiline + COMT inhibitors", "Parkinson's"],
["PLATES + MVC", "Penicillins, Lincosamides, Aminoglycosides, Tetracyclines, Macrolides, Sulfonamides + Metronidazole, Vancomycin, Carbapenems", "Antibiotics"],
["SFF-NEE", "Statins, Fibrates, Fish Oil, Niacin, Ezetimibe, PCSK9 Inhibitors", "Lipid-lowering"],
["1-2-3-4-5 Ceph", "Each generation ↑ Gram(-), ↓ Gram(+); 5th gen covers MRSA", "Cephalosporins"],
],
[W*0.20, W*0.52, W*0.28],
hdr_bg=C_ORANGE, alt_bg=C_LIGHT_ORANGE
))
story.append(sp(8))
# High-yield exam boxes
story.append(Paragraph("High-Yield Exam Facts", sH2))
exam_facts = [
["⚠ Drug to AVOID in absence seizures:", "Carbamazepine (worsens)"],
["⚠ Only cephalosporin covering MRSA:", "Ceftaroline (5th gen)"],
["⚠ Antidepressant safe in pregnancy:", "Sertraline (SSRIs preferred)"],
["⚠ Antipsychotic requiring CBC monitoring:", "Clozapine (agranulocytosis)"],
["⚠ Antibiotic + alcohol = vomiting:", "Metronidazole (disulfiram-like)"],
["⚠ DON'T give fluoroquinolones to:", "Children < 18, pregnant women (tendon/cartilage damage)"],
["⚠ Best drug for status epilepticus:", "Lorazepam IV (first) → Fosphenytoin → Phenobarbital"],
["⚠ Heart failure + best mortality benefit:", "Sacubitril/Valsartan (ARNI) > ACEi/ARB"],
["⚠ First-line for community-acquired MRSA:", "TMP-SMX (oral); Vancomycin IV for severe"],
["⚠ Valproate contraindication:", "Pregnancy (spina bifida); Liver disease"],
]
ef_t = Table(exam_facts, colWidths=[W*0.50, W*0.50])
ef_t.setStyle(TableStyle([
("GRID", (0,0), (-1,-1), 0.4, C_ORANGE),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ROWBACKGROUNDS",(0,0), (-1,-1), [C_LIGHT_YELLOW, C_WHITE]),
("FONTNAME", (0,0), (-1,-1), "Helvetica"),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("FONTNAME", (0,0), (0,-1), "Helvetica-Bold"),
("TEXTCOLOR", (0,0), (0,-1), C_RED),
]))
story.append(ef_t)
story.append(sp(12))
# Footer
footer_data = [[
Paragraph("Pharmacology Drug Classification Study Guide | MBBS/MD / USMLE/NEET Edition | 2026",
S("ft", fontName="Helvetica", fontSize=7.5, textColor=C_WHITE, alignment=TA_CENTER))
]]
ft = Table(footer_data, colWidths=[W])
ft.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), C_DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
]))
story.append(ft)
# ── Build ──────────────────────────────────────────────────────────────────────
doc.build(story)
print("PDF created successfully!")
cd /tmp/workspace/pharma-guide && python generate_pdf.py 2>&1
ls -lh /tmp/workspace/pharma-guide/Pharmacology_Drug_Classification.pdf
Pharmacology Drug Classification
PDF Document · PDF
| Page | Content |
|---|---|
| Page 1 | Cardiovascular Drugs - ABCD antihypertensives, Vaughan Williams antiarrhythmics, Heart Failure drugs, Lipid-lowering (SFF-NEE) |
| Page 2 | CNS/Psych Drugs - SMART antidepressants, Typical vs Atypical antipsychotics (CORQAZ), Anxiolytics (LETMiN), Antiepileptics by seizure type, Parkinson's (ACDS) |
| Page 3 | Antibiotics - PLATES+MVC classes, Coverage cheat sheet, Cephalosporin generations, Key side effects (must-know toxicities) |
| Page 4 | Quick Mnemonics summary table + 10 High-Yield Exam Facts in colour-coded boxes |
Can you take reference from these pdf as they are important question can you arrange answers of the question give in pdf with flowchart and proper format for better understanding
cd /tmp/workspace && python3 -c " import pdfplumber pdf_path = '/tmp/workspace/attachments/252cddc0-80f7-4625-95d3-4cf18260ff68/Microbiology imps by Kirat datt And Sumit Sharma.pdf' with pdfplumber.open(pdf_path) as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() print(f'\\n===== PAGE {i+1} =====') print(text) " 2>&1
python3 -c " from pypdf import PdfReader, PdfWriter import os pdf_path = '/tmp/workspace/attachments/252cddc0-80f7-4625-95d3-4cf18260ff68/Microbiology imps by Kirat datt And Sumit Sharma.pdf' reader = PdfReader(pdf_path) print(f'Pages: {len(reader.pages)}') # Save each page as individual PDF for analysis os.makedirs('/tmp/workspace/pharma-guide/pages', exist_ok=True) for i, page in enumerate(reader.pages): writer = PdfWriter() writer.add_page(page) with open(f'/tmp/workspace/pharma-guide/pages/page_{i+1}.pdf', 'wb') as f: writer.write(f) print(f'Saved page {i+1}') "
python3 -c " import subprocess, base64, json, os # Convert each PDF page to PNG using Python (Pillow + pdf2image if available, else use pypdf rendering) # Try pdf2image first try: from pdf2image import convert_from_path pages = convert_from_path('/tmp/workspace/attachments/252cddc0-80f7-4625-95d3-4cf18260ff68/Microbiology imps by Kirat datt And Sumit Sharma.pdf', dpi=200) os.makedirs('/tmp/workspace/pharma-guide/pages_img', exist_ok=True) for i, page in enumerate(pages): path = f'/tmp/workspace/pharma-guide/pages_img/page_{i+1}.png' page.save(path, 'PNG') print(f'Saved {path}') print('Done with pdf2image') except ImportError: print('pdf2image not available') except Exception as e: print(f'Error: {e}') "
python3 -c " import base64, os # Convert each PNG to base64 data URL and print sizes for i in range(1,7): path = f'/tmp/workspace/pharma-guide/pages_img/page_{i}.png' size = os.path.getsize(path) print(f'page_{i}.png: {size/1024:.1f} KB') "
python3 -c " import base64 # Create data URLs for pages 1-3 for i in range(1, 4): path = f'/tmp/workspace/pharma-guide/pages_img/page_{i}.png' with open(path, 'rb') as f: data = base64.b64encode(f.read()).decode() # just print first 80 chars to confirm print(f'page_{i}: data:image/png;base64,{data[:60]}...') "
python3 -c " # Try pytesseract for OCR try: import pytesseract from PIL import Image img = Image.open('/tmp/workspace/pharma-guide/pages_img/page_1.png') text = pytesseract.image_to_string(img) print('pytesseract works!') print(text[:500]) except ImportError: print('pytesseract not available') except Exception as e: print(f'Error: {e}') "
python3 -c " # Try markitdown which can handle images try: from markitdown import MarkItDown md = MarkItDown() result = md.convert('/tmp/workspace/attachments/252cddc0-80f7-4625-95d3-4cf18260ff68/Microbiology imps by Kirat datt And Sumit Sharma.pdf') print(result.text_content[:3000]) except Exception as e: print(f'Error: {e}') "
# Start a simple HTTP server to serve images so analyse_media can access them python3 -m http.server 8765 --directory /tmp/workspace/pharma-guide/pages_img & sleep 2 echo "Server started, PID=$!" # Test it curl -s -o /dev/null -w "%{http_code}" http://localhost:8765/page_1.png
# Compress images to smaller size for fetch_image python3 -c " from PIL import Image import os os.makedirs('/tmp/workspace/pharma-guide/pages_small', exist_ok=True) for i in range(1, 7): img = Image.open(f'/tmp/workspace/pharma-guide/pages_img/page_{i}.png') # Resize to width 1200 keeping aspect ratio w, h = img.size new_w = 1200 new_h = int(h * new_w / w) img = img.resize((new_w, new_h), Image.LANCZOS) out = f'/tmp/workspace/pharma-guide/pages_small/page_{i}.jpg' img.save(out, 'JPEG', quality=85) size = os.path.getsize(out) print(f'page_{i}.jpg: {size/1024:.1f} KB, size={new_w}x{new_h}') "
# Start HTTP server for smaller images pkill -f "http.server 8765" 2>/dev/null || true python3 -m http.server 8766 --directory /tmp/workspace/pharma-guide/pages_small & sleep 2 curl -s -o /dev/null -w "HTTP Status: %{http_code}" http://localhost:8766/page_1.jpg
# Try easyocr python3 -c " try: import easyocr reader = easyocr.Reader(['en'], gpu=False, verbose=False) results = reader.readtext('/tmp/workspace/pharma-guide/pages_small/page_1.jpg', detail=0) print('EasyOCR works!') for r in results[:30]: print(r) except ImportError: print('easyocr not available') except Exception as e: print(f'Error: {e}') "
# Try to use the vision capability by reading images as base64 and writing to a txt via ollama or similar # Let's try if there's any vision model or PIL-based text extraction available python3 -c " # Try using pypdf with different extraction settings from pypdf import PdfReader reader = PdfReader('/tmp/workspace/attachments/252cddc0-80f7-4625-95d3-4cf18260ff68/Microbiology imps by Kirat datt And Sumit Sharma.pdf') for i, page in enumerate(reader.pages): # Try visitor-based extraction parts = [] def visitor(text, cm, tm, fontDict, fontSize): if text.strip(): parts.append(text) page.extract_text(visitor_text=visitor) if parts: print(f'PAGE {i+1}:', ' '.join(parts[:50])) else: print(f'PAGE {i+1}: [no extractable text]') # Check for images print(f' Images on page: {len(page.images)}') if page.images: img = page.images[0] print(f' First image: {img.name}, size={len(img.data)} bytes') # Save the first image from page 1 for testing if i == 0: with open('/tmp/workspace/pharma-guide/extracted_page1_img0.jpg', 'wb') as f: f.write(img.data) print(f' Saved image') "
# Extract all 6 images directly from PDF and save them python3 -c " from pypdf import PdfReader import os reader = PdfReader('/tmp/workspace/attachments/252cddc0-80f7-4625-95d3-4cf18260ff68/Microbiology imps by Kirat datt And Sumit Sharma.pdf') os.makedirs('/tmp/workspace/pharma-guide/raw_images', exist_ok=True) for i, page in enumerate(reader.pages): if page.images: img = page.images[0] ext = 'png' if img.name.endswith('png') else 'jpg' path = f'/tmp/workspace/pharma-guide/raw_images/page_{i+1}.{ext}' with open(path, 'wb') as f: f.write(img.data) size = os.path.getsize(path) print(f'Saved page_{i+1}.{ext}: {size/1024:.1f} KB') "
analyse_media cannot reach local filesPaste the microbiology questions from your PDF into this chat