Can you give me more easy classification of pharmacology drugs which is easy to remember

Asking for Preferences
Here is a clean, memory-friendly classification of pharmacology drugs organized by system - designed for MBBS/MD students preparing for USMLE/NEET. Each category uses a simple logic hook so you can reconstruct the list from first principles.

Pharmacology Drug Classification - Easy Memory Guide


1. CARDIOVASCULAR DRUGS

A. Antihypertensives - "A B C D" Rule

LetterClassExamples
AACE Inhibitors / ARBsEnalapril, Losartan
BBeta-blockersMetoprolol, Atenolol
CCalcium Channel BlockersAmlodipine, Nifedipine, Verapamil
DDiureticsHydrochlorothiazide, Furosemide
Memory tip: "ABCDs of BP" - Start with A for most patients, D for Blacks/elderly.

B. Antiarrhythmics - Vaughan Williams Classification

ClassMechanismDrugsHook
IaNa+ channel block (slow)Quinidine, Procainamide"Queen Proclaims"
IbNa+ channel block (fast)Lidocaine, MexiletinePost-MI use
IcNa+ channel block (slow-in, slow-out)Flecainide, PropafenoneAvoid in structural heart disease
IIBeta-blockersMetoprolol, EsmololSlow the node
IIIK+ channel blockAmiodarone, Sotalol"Am I Sore?"
IVCa2+ channel blockVerapamil, DiltiazemSVT
Memory tip: "Some Blocks Kill All Arrhythmias" = Na+, Beta, K+, All = Ca2+

C. Antianginals

  • Nitrates - Nitroglycerin, Isosorbide (venodilators - reduce preload)
  • Beta-blockers - Metoprolol (reduce HR and demand)
  • CCBs - Amlodipine (vasospastic angina)
  • Ranolazine - Late Na+ current blocker (add-on)

D. Heart Failure Drugs - "ABCD + Diuretics"

DrugBenefit
ACE inhibitors/ARBsReduce mortality
Beta-blockers (carvedilol, metoprolol)Reduce mortality
Carbinol (Sacubitril/Valsartan - ARNI)Best new agent
DiureticsSymptom relief only
DigoxinSymptom relief, rate control
SpironolactoneReduce mortality (add-on)

E. Lipid-Lowering Drugs - "SFF-NEE"

DrugTarget
StatinsLDL (main drug)
FibratesTG
Fish oil (Omega-3)TG
NiacinLDL + TG, raises HDL
EzetimibeLDL (blocks absorption)
Evolucomab (PCSK9i)LDL (injectable)

2. CNS / PSYCHIATRIC DRUGS

A. Antidepressants - "SMART"

ClassExamplesMechanism
SSRIFluoxetine, Sertraline, Citalopram5-HT reuptake block
SNRIVenlafaxine, Duloxetine5-HT + NE reuptake block
MAO InhibitorPhenelzine, TranylcypromineMAO inhibition - watch tyramine!
AtypicalMirtazapine, Bupropion, TrazodoneMixed mechanisms
Rycyclic (Tri)Amitriptyline, Imipramine, ClomipramineNE + 5-HT + anticholinergic
Memory tip: SSRIs are first-line. TCAs used for OCD (clomipramine), bedwetting (imipramine), neuropathic pain.

B. Antipsychotics

Typical (1st gen) - "Haloperidol is the King"
  • High potency: Haloperidol, Fluphenazine (high EPS risk)
  • Low potency: Chlorpromazine, Thioridazine (more sedation/anticholinergic)
  • Mechanism: D2 blockade
Atypical (2nd gen) - "CLOZAPINE and friends"
DrugSpecial Feature
ClozapineBest for refractory; agranulocytosis risk - CBC monitoring
OlanzapineWeight gain, metabolic syndrome
RisperidoneMost EPS among atypicals
QuetiapineSafest in Parkinson's/DLB
AripiprazolePartial D2 agonist - least metabolic side effects
ZiprasidoneQT prolongation
Memory tip: "CORQAZ" = Clozapine, Olanzapine, Risperidone, Quetiapine, Aripiprazole, Ziprasidone

C. Anxiolytics / Sedatives

Drug ClassExamplesKey Point
BenzodiazepinesDiazepam, Lorazepam, MidazolamGABA-A - risk of dependence
BuspironeBuspirone5-HT1A agonist - no dependence, delayed onset
Z-drugsZolpidem, ZaleplonSleep only; less dependence
Beta-blockersPropranololSituational anxiety (tremor)
Short-acting benzos for sleep (LETMiN): Lorazepam, Estazolam, Temazepam, Midazolam

D. Antiepileptics - by seizure type

Seizure TypeFirst-Line Drug
Generalized tonic-clonicValproate, Phenytoin, Carbamazepine
AbsenceEthosuximide (or Valproate)
Partial/FocalCarbamazepine, Levetiracetam
Status epilepticusLorazepam → Fosphenytoin → Phenobarbital
MyoclonicValproate, Levetiracetam
Memory: "VPA does everything" - Valproate is broad-spectrum but teratogenic (avoid in pregnancy).

E. Parkinson's Drugs - "ACDS"

DrugMechanism
AmantadineNMDA antagonist, increases DA release
Carbidopa/LevodopaDA precursor (carbidopa prevents peripheral conversion)
Dopamine agonistsRopinirole, Pramipexole (young patients)
SelegilineMAO-B inhibitor (neuroprotective?)
+ COMT inhibitorsEntacapone, Tolcapone (prolong levodopa effect)
+ AnticholinergicsTrihexyphenidyl (for tremor only)

3. ANTIBIOTICS / ANTI-INFECTIVES

A. The Classic "MSSA vs MRSA" Rule

  • MSSA: Nafcillin, Oxacillin (beta-lactamase resistant penicillins)
  • MRSA: Vancomycin (IV), Linezolid (oral), Daptomycin, TMP-SMX (community MRSA)

B. Antibiotics by Class - "PLATES + MVC"

ClassKey DrugsCoverage
PenicillinsAmoxicillin, PiperacillinGram +/-
LincosamidesClindamycinGram+, anaerobes
AminoglycosidesGentamicin, AmikacinGram- (aerobic)
TetracyclinesDoxycycline, MinocyclineAtypicals, Rickettsia
Erythromycin (Macrolides)Azithromycin, ClarithromycinAtypicals, Strep
SulfonamidesTMP-SMXUTI, PCP
MetronidazoleMetronidazoleAnaerobes, protozoa
VancomycinVancomycinMRSA, C. diff (oral)
CarbapenemsMeropenem, ImipenemBroadest spectrum

C. Antibiotic Coverage at a Glance

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

D. Cephalosporins - Generation Memory Trick

GenerationCoverage HookKey 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(+).

E. Key Anti-infective Side Effects to Remember

DrugClassic Side Effect
AminoglycosidesNephrotoxicity + Ototoxicity
Vancomycin"Red Man Syndrome" (infusion), nephrotoxicity
MetronidazoleMetallic taste, disulfiram-like reaction with alcohol
FluoroquinolonesTendon rupture, QT prolongation, avoid in kids
TetracyclinesPhotosensitivity, avoid in pregnancy/children
Chloramphenicol"Gray baby syndrome," aplastic anemia
ClindamycinC. difficile colitis
RifampinOrange urine/secretions, major CYP450 inducer

4. QUICK MNEMONICS SUMMARY

MnemonicMeaning
ABCDs of HTNACEi, Beta-blocker, CCB, Diuretic
CORQAZAtypical antipsychotics
PLATES + MVCAntibiotic classes
1-2-3-4-5 CephCephalosporin generations
VPA does everythingValproate is broad-spectrum AED
SMART antidepressantsSSRI, SNRI, MAOI, Atypical, TCA

This gives you a logical scaffold - each class has a mechanism anchor, a coverage/use hook, and a key side effect. Want me to go deeper on any specific category, add more mnemonics, or create a printable PDF/table version of this?

Create a printable PDF study guide of this drug classification

Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/pharma-guide && ls /tmp/workspace/

Writing File

~/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!")
Running Command

cd /tmp/workspace/pharma-guide && python generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/pharma-guide/Pharmacology_Drug_Classification.pdf

Your printable PDF study guide is ready! Here is your download link:

Pharmacology Drug Classification

PDF Document · PDF


What's inside the PDF (4 pages, A4, print-ready):
PageContent
Page 1Cardiovascular Drugs - ABCD antihypertensives, Vaughan Williams antiarrhythmics, Heart Failure drugs, Lipid-lowering (SFF-NEE)
Page 2CNS/Psych Drugs - SMART antidepressants, Typical vs Atypical antipsychotics (CORQAZ), Anxiolytics (LETMiN), Antiepileptics by seizure type, Parkinson's (ACDS)
Page 3Antibiotics - PLATES+MVC classes, Coverage cheat sheet, Cephalosporin generations, Key side effects (must-know toxicities)
Page 4Quick Mnemonics summary table + 10 High-Yield Exam Facts in colour-coded boxes
Design features:
  • Colour-coded by system (Blue = Cardio, Purple = CNS, Green = Antibiotics, Orange = Mnemonics)
  • Alternating row shading for easy reading
  • Tip boxes with mnemonics highlighted in green
  • Warning boxes for high-yield exam traps in red/yellow

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

Reading File
Running Command

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

Running Command

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}') "

Running Command

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}') "

Running Command

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') "

Running Command

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]}...') "

analyse_media
Running Command

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}') "

Running Command

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}') "

Running Command

# 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

analyse_media
Reading File
Running Command

# 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}') "

Running Command

# 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

Loading Image
Running Command

# 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}') "

Running Command

# 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') "

Running Command

# 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') "

Loading Image
I've hit my budget limit while trying to read the scanned PDF. Here's a transparent summary of what happened and what I need from you to continue:

What I Found

The PDF "Microbiology imps by Kirat datt And Sumit Sharma" is a fully image-based/scanned PDF - every page is a single embedded PNG image with no machine-readable text. This means standard text extraction tools (pdfplumber, pypdf, markitdown) all return empty results.
To read its content I need either:
  1. OCR tools (pytesseract, easyocr) - not installed in this sandbox
  2. Vision AI access to local files - the sandbox doesn't expose a public URL, so analyse_media cannot reach local files
  3. You to share the text/questions directly in the chat

How to Continue - 3 Options

Option 1 (Fastest) - Type/Paste the Questions

Copy-paste the questions from the PDF into the chat. I'll immediately create a beautiful formatted PDF with flowcharts and answers for every question.

Option 2 - Re-upload as a Text-Searchable PDF

If you have access to the original Word/text file these questions came from, share that instead. Or open the PDF in Google Docs (it auto-OCRs) and paste the text here.

Option 3 - Tell Me the Topics

If the questions are from standard Microbiology MBBS topics, just tell me the subject areas (e.g. Bacteriology, Virology, Immunology, Mycology, Parasitology) and I'll create a comprehensive Microbiology IMP Questions + Answers PDF with flowcharts covering all high-yield exam topics for MBBS/NEET/USMLE - without needing to read the file.

Reply with "continue" and whichever option you prefer, and I'll build the full study guide PDF right away.

Paste the microbiology questions from your PDF into this chat

I'm not able to paste the questions from the PDF - I cannot read the content because the PDF is fully image/scan-based and I don't have OCR capability in this environment to extract the text from it.
What you can do:
  1. Open the PDF on your phone or computer, select all text (Ctrl+A), and paste it here. If text selection doesn't work, the PDF is scanned.
  2. Open it in Google Docs: Go to drive.google.com, upload the PDF, right-click it and choose "Open with Google Docs" - it will auto-OCR the text. Then copy-paste it here.
  3. Just tell me the topic areas covered in the PDF (e.g. "Gram staining, bacterial growth, virology, immunology, antifungals...") and I'll build a complete Microbiology IMP Q&A PDF with flowcharts based on standard MBBS exam questions for those topics - no need to read the file at all.
Option 3 is actually the fastest path. Which topics does the PDF cover?
This is a shared conversation. Sign in to Orris to start your own chat.