Classification of antibiotic and which bacteria they act
| Bactericidal | Bacteriostatic |
|---|---|
| β-Lactams | Tetracyclines |
| Aminoglycosides | Macrolides (azithromycin, erythromycin) |
| Fluoroquinolones | Sulfonamides |
| Vancomycin | Trimethoprim |
| Chloramphenicol | |
| Clindamycin |
Nitrofurantoin is generally bacteriostatic but can be bactericidal at high doses.
| Subclass | Examples | Gram (+) Coverage | Gram (−) Coverage |
|---|---|---|---|
| Aminopenicillins | Amoxicillin, Ampicillin | Streptococcus, Enterococci | Proteus mirabilis |
| + β-lactamase inhibitor | Amoxicillin-clavulanate, Ampicillin-sulbactam | Streptococcus, Enterococci, Staph (not MRSA) | P. mirabilis, Klebsiella, H. influenzae |
| Antistaphylococcal penicillins | Nafcillin, Oxacillin, Dicloxacillin | Streptococcus, Staphylococcus (not MRSA) | None |
| Antipseudomonal penicillins | Piperacillin-tazobactam | Streptococcus, Enterococci | Most GNRs including Pseudomonas aeruginosa |
| 1st-gen cephalosporins | Cefazolin, Cefalexin | Streptococcus, Staph (not MRSA) | E. coli, P. mirabilis, Klebsiella |
| 2nd-gen cephalosporins | Cefuroxime, Cefaclor (Group 1) | Streptococcus, Staph (not MRSA) | E. coli, P. mirabilis, H. influenzae, Klebsiella |
| Cefoxitin, Cefotetan (Group 2) | Streptococcus | E. coli, Proteus spp., H. influenzae, anaerobes | |
| 3rd-gen cephalosporins | Ceftriaxone | Streptococcus, Staph (not MRSA) | Most GNRs, excluding P. aeruginosa |
| Ceftazidime | Streptococcus | Most GNRs including P. aeruginosa | |
| 4th-gen cephalosporins | Cefepime | Streptococcus, Staph (not MRSA) | Broad GNRs including P. aeruginosa |
| 5th-gen cephalosporins | Ceftaroline | Streptococcus, MRSA | Broad GNRs (not Pseudomonas) |
| Monobactam | Aztreonam | None | Most GNRs including P. aeruginosa |
| Carbapenems | Imipenem, Meropenem, Ertapenem | Streptococcus, Staph (not MRSA) | Broadest — most GNRs including Pseudomonas (not Ertapenem) |
| Siderophore cephalosporin | Cefiderocol | Limited | Targets resistant GNRs via iron-chelation transport into outer membrane |
| Drug Class | Examples | Spectrum | Notes |
|---|---|---|---|
| Aminoglycosides | Gentamicin, Tobramycin, Amikacin, Streptomycin | Aerobic GNRs (E. coli, Pseudomonas, Klebsiella); synergistic on Gram (+) with β-lactams/vancomycin | Bactericidal; concentration-dependent; nephrotoxic/ototoxic |
| Tetracyclines | Tetracycline, Doxycycline, Minocycline | Broad spectrum — Gram (+), Gram (−), atypicals (Chlamydia, Mycoplasma, Rickettsia, Brucella) | Bacteriostatic |
| Glycylcyclines | Tigecycline | Very broad — MRSA, VRE, most GNRs, anaerobes (not Pseudomonas) | Overcomes classic tetracycline resistance |
| Drug Class | Examples | Spectrum | Notes |
|---|---|---|---|
| Macrolides | Erythromycin, Azithromycin, Clarithromycin | Gram (+) strep/staph, atypicals (Legionella, Mycoplasma, Chlamydia) | Bacteriostatic |
| Lincosamides | Clindamycin | S. aureus (not MRSA), Streptococcus, anaerobes | Bacteriostatic; no Gram (−) coverage |
| Chloramphenicol | Chloramphenicol | Broad — Gram (+), Gram (−), anaerobes, Rickettsia | Bacteriostatic; bone marrow toxicity |
| Oxazolidinones | Linezolid | Gram (+) only — MRSA, VRE, Streptococcus | Bacteriostatic |
| Streptogramins | Quinupristin-dalfopristin | Gram (+) — S. aureus, Streptococcus, VRE (E. faecium only) | Bactericidal in combination |
| Generation | Examples | Spectrum |
|---|---|---|
| 1st | Nalidixic acid | Gram (−) (urinary only) |
| 2nd | Ciprofloxacin, Ofloxacin | Broad GNRs including P. aeruginosa; limited Gram (+) |
| 3rd | Levofloxacin | Broad GNRs + enhanced Gram (+) (S. pneumoniae) |
| 4th | Moxifloxacin | Broad + anaerobes; not Pseudomonas |
| Drug | Target | Spectrum |
|---|---|---|
| Sulfonamides (sulfamethoxazole) | Dihydropteroate synthase (blocks PABA incorporation) | Gram (+), Gram (−) (Nocardia, Klebsiella granulomatis, H. ducreyi); also some fungi/parasites |
| Trimethoprim | Dihydrofolate reductase | Gram (+), Gram (−) — works synergistically with sulfonamides |
| TMP-SMX (co-trimoxazole) | Sequential blockade of folate pathway | E. coli, Staph, Streptococcus, H. influenzae, Pneumocystis jirovecii, Nocardia, Toxoplasma |
| Drug | Mechanism | Spectrum |
|---|---|---|
| Polymyxins (colistin, polymyxin B) | Disrupt outer membrane of GNRs | Resistant GNRs — Acinetobacter, Pseudomonas, CRE; last-resort agents |
| Daptomycin | Depolarizes Gram (+) cell membrane | S. aureus (MRSA), Streptococcus, VRE |
| Antibiotic Class | Gram (+) | Gram (−) | Anaerobes | Atypicals | Mycobacteria |
|---|---|---|---|---|---|
| Penicillin G/V | ✓✓ | Limited | Some | — | — |
| Aminopenicillins | ✓ | Limited | — | — | — |
| Antipseudomonal PCN | ✓ | ✓✓ (+ Pseudomonas) | ✓ | — | — |
| 1st-gen cephalosporins | ✓ | Limited | — | — | — |
| 3rd-gen cephalosporins | ✓ | ✓✓ | — | — | — |
| Carbapenems | ✓ | ✓✓ | ✓✓ | — | — |
| Vancomycin | ✓✓ (MRSA, VRE) | — | — | — | — |
| Aminoglycosides | Synergy only | ✓✓ | — | — | Streptomycin |
| Tetracyclines | ✓ | ✓ | Some | ✓✓ | — |
| Macrolides | ✓ | Limited | — | ✓✓ | Some |
| Fluoroquinolones | ✓ (3rd/4th) | ✓✓ | 4th gen | — | Some |
| Metronidazole | — | — | ✓✓ | — | — |
| TMP-SMX | ✓ | ✓ | — | Some | — |
| Rifampicin | ✓ | — | — | — | ✓✓ |
| Polymyxins | — | ✓✓ (resistant) | — | — | — |
| Linezolid | ✓✓ (MRSA, VRE) | — | — | — | Some |
Please make a pdf of this in colourful systematic way
ls -la /home/daytona/workspace/
mkdir -p /home/daytona/workspace/antibiotics-pdf
~/antibiotics-pdf/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, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
from reportlab.lib.colors import HexColor
OUTPUT = "/home/daytona/workspace/antibiotics-pdf/Antibiotic_Classification.pdf"
# ── Colour palette ──────────────────────────────────────────────
NAVY = HexColor("#1A237E")
TEAL = HexColor("#00695C")
PURPLE = HexColor("#6A1B9A")
DARK_RED = HexColor("#B71C1C")
DARK_BLUE = HexColor("#0D47A1")
ORANGE = HexColor("#E65100")
GREEN = HexColor("#2E7D32")
INDIGO = HexColor("#283593")
LIGHT_NAVY = HexColor("#E8EAF6")
LIGHT_TEAL = HexColor("#E0F2F1")
LIGHT_PURPLE= HexColor("#F3E5F5")
LIGHT_RED = HexColor("#FFEBEE")
LIGHT_BLUE = HexColor("#E3F2FD")
LIGHT_ORANGE= HexColor("#FFF3E0")
LIGHT_GREEN = HexColor("#E8F5E9")
LIGHT_INDIGO= HexColor("#E8EAF6")
WHITE = colors.white
BLACK = colors.black
GREY = HexColor("#F5F5F5")
MID_GREY = HexColor("#BDBDBD")
# ── Styles ───────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
title_style = S("DocTitle",
fontName="Helvetica-Bold", fontSize=26, textColor=WHITE,
alignment=TA_CENTER, spaceAfter=4, leading=32)
subtitle_style = S("DocSub",
fontName="Helvetica", fontSize=13, textColor=HexColor("#B2EBF2"),
alignment=TA_CENTER, spaceAfter=6, leading=18)
source_style = S("Source",
fontName="Helvetica-Oblique", fontSize=8, textColor=HexColor("#CFD8DC"),
alignment=TA_CENTER, spaceAfter=2)
h1_style = S("H1",
fontName="Helvetica-Bold", fontSize=15, textColor=WHITE,
spaceAfter=4, spaceBefore=10, leading=20)
h2_style = S("H2",
fontName="Helvetica-Bold", fontSize=12, textColor=WHITE,
spaceAfter=3, spaceBefore=6, leading=16)
h3_style = S("H3",
fontName="Helvetica-Bold", fontSize=10, textColor=NAVY,
spaceAfter=3, spaceBefore=5, leading=13)
body_style = S("Body",
fontName="Helvetica", fontSize=9, textColor=HexColor("#212121"),
spaceAfter=3, leading=13)
note_style = S("Note",
fontName="Helvetica-Oblique", fontSize=8, textColor=HexColor("#555555"),
spaceAfter=4, leading=11)
cell_head = S("CellHead",
fontName="Helvetica-Bold", fontSize=8, textColor=WHITE,
alignment=TA_CENTER, leading=10)
cell_body = S("CellBody",
fontName="Helvetica", fontSize=7.5, textColor=HexColor("#212121"),
alignment=TA_LEFT, leading=10)
cell_center = S("CellCenter",
fontName="Helvetica", fontSize=7.5, textColor=HexColor("#212121"),
alignment=TA_CENTER, leading=10)
cell_bold = S("CellBold",
fontName="Helvetica-Bold", fontSize=7.5, textColor=HexColor("#212121"),
alignment=TA_LEFT, leading=10)
# ── Helpers ──────────────────────────────────────────────────────
def section_header(text, bg_color, style=h1_style):
tbl = Table([[Paragraph(text, style)]], colWidths=[17*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg_color),
("ROUNDEDCORNERS", [6, 6, 6, 6]),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 14),
]))
return tbl
def sub_header(text, bg_color):
tbl = Table([[Paragraph(text, h2_style)]], colWidths=[17*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg_color),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 20),
]))
return tbl
def mk_table(headers, rows, col_widths, header_bg, alt_bg, header_styles=None):
"""Create a styled table."""
data = [[Paragraph(h, cell_head) for h in headers]]
for i, row in enumerate(rows):
styled_row = []
for j, cell in enumerate(row):
if isinstance(cell, str):
styled_row.append(Paragraph(cell, cell_body))
else:
styled_row.append(cell)
data.append(styled_row)
style_cmds = [
("BACKGROUND", (0, 0), (-1, 0), header_bg),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, alt_bg]),
("GRID", (0, 0), (-1, -1), 0.4, MID_GREY),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 6),
("RIGHTPADDING", (0, 0), (-1, -1), 6),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, alt_bg]),
]
tbl = Table(data, colWidths=col_widths)
tbl.setStyle(TableStyle(style_cmds))
return tbl
# ── Document setup ────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="Classification of Antibiotics",
author="Orris Medical Reference"
)
story = []
# ══════════════════════════════════════════════════════════════════
# COVER BANNER
# ══════════════════════════════════════════════════════════════════
cover_title = Table(
[[Paragraph("Classification of Antibiotics", title_style)],
[Paragraph("Spectrum, Mechanism of Action & Target Bacteria", subtitle_style)],
[Paragraph("Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics · Campbell-Walsh Urology · Katzung's Basic & Clinical Pharmacology", source_style)]],
colWidths=[17*cm]
)
cover_title.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TOPPADDING", (0,0), (-1,-1), 18),
("BOTTOMPADDING", (0,0), (-1,-1), 18),
("LEFTPADDING", (0,0), (-1,-1), 14),
("RIGHTPADDING", (0,0), (-1,-1), 14),
("ROWBACKGROUNDS", (0,0), (-1,-1), [NAVY]),
]))
story.append(cover_title)
story.append(Spacer(1, 10))
# ══════════════════════════════════════════════════════════════════
# SECTION 1 — BACTERICIDAL vs BACTERIOSTATIC
# ══════════════════════════════════════════════════════════════════
story.append(section_header("I. Bactericidal vs Bacteriostatic Antibiotics", DARK_BLUE))
story.append(Spacer(1, 5))
bact_data = [
[Paragraph("💉 BACTERICIDAL", cell_head), Paragraph("🧪 BACTERIOSTATIC", cell_head)],
[Paragraph("β-Lactams (Penicillins, Cephalosporins,\nCarbapenems, Monobactams)", cell_body),
Paragraph("Tetracyclines", cell_body)],
[Paragraph("Aminoglycosides", cell_body),
Paragraph("Macrolides (Azithromycin, Erythromycin,\nClarithromycin)", cell_body)],
[Paragraph("Fluoroquinolones", cell_body),
Paragraph("Sulfonamides", cell_body)],
[Paragraph("Vancomycin", cell_body),
Paragraph("Trimethoprim", cell_body)],
[Paragraph("Daptomycin", cell_body),
Paragraph("Chloramphenicol", cell_body)],
[Paragraph("Metronidazole (anaerobes)", cell_body),
Paragraph("Clindamycin", cell_body)],
[Paragraph("Rifampicin", cell_body),
Paragraph("Linezolid", cell_body)],
]
bact_tbl = Table(bact_data, colWidths=[8.5*cm, 8.5*cm])
bact_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), DARK_BLUE),
("BACKGROUND", (1,0), (1,0), TEAL),
("ROWBACKGROUNDS", (0,1), (0,-1), [LIGHT_BLUE, WHITE]),
("ROWBACKGROUNDS", (1,1), (1,-1), [LIGHT_TEAL, WHITE]),
("GRID", (0,0), (-1,-1), 0.5, MID_GREY),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 8),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(bact_tbl)
story.append(Paragraph(
"* Nitrofurantoin is generally bacteriostatic but can be bactericidal at high doses against certain organisms.",
note_style))
story.append(Spacer(1, 8))
# ══════════════════════════════════════════════════════════════════
# SECTION 2 — CLASSIFICATION BY MECHANISM
# ══════════════════════════════════════════════════════════════════
story.append(section_header("II. Classification by Mechanism of Action", TEAL))
story.append(Spacer(1, 6))
# ── 2A. Cell Wall — β-Lactams ─────────────────────────────────────
story.append(sub_header("A. Cell Wall Synthesis Inhibitors — β-Lactams", INDIGO))
story.append(Spacer(1, 4))
story.append(Paragraph(
"All β-lactams share a β-lactam ring and inhibit Penicillin-Binding Proteins (PBPs), "
"blocking peptidoglycan cross-linking. "
"<b>Resistance mechanisms:</b> β-lactamase production, altered PBPs (MRSA), reduced outer membrane porin penetration.",
body_style))
story.append(Spacer(1, 4))
blactam_headers = ["Subclass", "Key Drugs", "Gram (+) Coverage", "Gram (−) Coverage"]
blactam_rows = [
["Aminopenicillins", "Amoxicillin, Ampicillin",
"Streptococcus, Enterococci", "Proteus mirabilis"],
["Aminopenicillins\n+ β-lactamase inhibitor",
"Amoxicillin-clavulanate,\nAmpicillin-sulbactam",
"Streptococcus, Enterococci,\nStaph (not MRSA)",
"P. mirabilis, Klebsiella spp.,\nH. influenzae"],
["Antistaphylococcal\nPenicillins",
"Nafcillin, Oxacillin,\nDicloxacillin",
"Streptococcus, Staph\n(not MRSA)", "None"],
["Antipseudomonal\nPenicillins",
"Piperacillin-tazobactam",
"Streptococcus, Enterococci",
"Most GNRs incl. P. aeruginosa"],
["1st-gen Cephalosporins",
"Cefazolin, Cefalexin",
"Streptococcus, Staph (not MRSA)",
"E. coli, P. mirabilis, Klebsiella"],
["2nd-gen Cephalosporins\n(Group 1)",
"Cefuroxime, Cefaclor",
"Streptococcus, Staph (not MRSA)",
"E. coli, P. mirabilis,\nH. influenzae, Klebsiella"],
["2nd-gen Cephalosporins\n(Group 2 — Cephamycins)",
"Cefoxitin, Cefotetan",
"Streptococcus",
"E. coli, Proteus spp.,\nH. influenzae, anaerobes"],
["3rd-gen Cephalosporins",
"Ceftriaxone",
"Streptococcus, Staph (not MRSA)",
"Most GNRs (excl. P. aeruginosa)"],
["3rd-gen Cephalosporins\n(Antipseudomonal)",
"Ceftazidime",
"Streptococcus",
"Most GNRs incl. P. aeruginosa"],
["4th-gen Cephalosporins",
"Cefepime",
"Streptococcus, Staph (not MRSA)",
"Broad GNRs incl. P. aeruginosa"],
["5th-gen Cephalosporins",
"Ceftaroline",
"Streptococcus, MRSA ✓",
"Broad GNRs (not Pseudomonas)"],
["Monobactam",
"Aztreonam",
"None",
"Most GNRs incl. P. aeruginosa"],
["Carbapenems",
"Imipenem, Meropenem,\nErtapenem",
"Streptococcus, Staph (not MRSA)",
"Broadest — most GNRs\n(Pseudomonas: Imipenem/Meropenem)"],
["Siderophore\nCephalosporin",
"Cefiderocol",
"Limited",
"Resistant GNRs via\niron-chelation transport"],
]
blactam_tbl = mk_table(
blactam_headers, blactam_rows,
[4.5*cm, 3.5*cm, 4.5*cm, 4.5*cm],
INDIGO, LIGHT_NAVY
)
story.append(blactam_tbl)
story.append(Spacer(1, 6))
# ── 2B. Glycopeptides ─────────────────────────────────────────────
story.append(sub_header("B. Cell Wall Inhibitors — Glycopeptides", DARK_RED))
story.append(Spacer(1, 4))
glyco_rows = [
["Vancomycin", "Binds D-Ala-D-Ala terminal of peptidoglycan precursor",
"S. aureus (MRSA ✓), S. epidermidis,\nStreptococcus, Enterococcus\n(VRE = resistant)",
"None — Gram (+) ONLY"],
["Teicoplanin", "Same as vancomycin",
"Similar to vancomycin", "None"],
["Dalbavancin\nOritavancin", "Lipoglycopeptides — prolonged action",
"MRSA, Streptococcus, VRE\n(Oritavancin)", "None"],
]
glyco_tbl = mk_table(
["Drug", "Mechanism", "Gram (+) Spectrum", "Gram (−)"],
glyco_rows,
[3*cm, 5*cm, 5.5*cm, 3.5*cm],
DARK_RED, LIGHT_RED
)
story.append(glyco_tbl)
story.append(Spacer(1, 8))
# ── PAGE BREAK ────────────────────────────────────────────────────
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════
# SECTION 3 — PROTEIN SYNTHESIS INHIBITORS
# ══════════════════════════════════════════════════════════════════
story.append(section_header("III. Protein Synthesis Inhibitors", PURPLE))
story.append(Spacer(1, 6))
# ── 30S ───────────────────────────────────────────────────────────
story.append(sub_header("A. 30S Ribosomal Subunit Inhibitors", PURPLE))
story.append(Spacer(1, 4))
s30_rows = [
["Aminoglycosides\n(Bactericidal)",
"Gentamicin, Tobramycin,\nAmikacin, Streptomycin,\nNeomycin, Plazomicin",
"Inhibit 30S subunit → misreading\nof mRNA → faulty proteins",
"Aerobic GNRs: E. coli, Klebsiella,\nPseudomonas, Proteus;\nSynergistic on streptococci,\nstaphylococci, enterococci\n(+ β-lactam or vancomycin)",
"Nephrotoxicity,\nOtotoxicity,\nNeuromuscular blockade"],
["Tetracyclines\n(Bacteriostatic)",
"Tetracycline, Doxycycline,\nMinocycline",
"Block aminoacyl-tRNA binding\nto 30S ribosome",
"Broad: Gram (+), Gram (−),\nAtypicals: Chlamydia, Mycoplasma,\nRickettsia, Brucella, Vibrio",
"Photosensitivity,\nTeeth/bone deposition\n(avoid in children <8 yrs)"],
["Glycylcyclines\n(Bacteriostatic)",
"Tigecycline",
"Same as tetracyclines +\noverrides efflux resistance",
"Very broad: MRSA, VRE,\nmost GNRs, anaerobes\n(NOT Pseudomonas)",
"Nausea/vomiting,\nhepatic dysfunction"],
]
s30_tbl = mk_table(
["Class", "Key Drugs", "Mechanism", "Bacterial Spectrum", "Key Toxicities"],
s30_rows,
[3*cm, 3.5*cm, 3.5*cm, 4.5*cm, 2.5*cm],
PURPLE, LIGHT_PURPLE
)
story.append(s30_tbl)
story.append(Spacer(1, 6))
# ── 50S ───────────────────────────────────────────────────────────
story.append(sub_header("B. 50S Ribosomal Subunit Inhibitors", DARK_RED))
story.append(Spacer(1, 4))
s50_rows = [
["Macrolides\n(Bacteriostatic)",
"Erythromycin,\nAzithromycin,\nClarithromycin",
"Block translocation at 50S\n(bind 23S rRNA)",
"Gram (+): Streptococcus, Staph;\nAtypicals: Legionella, Mycoplasma,\nChlamydia, Bordetella pertussis",
"GI upset, QTc prolongation,\nCYP450 interactions"],
["Lincosamides\n(Bacteriostatic)",
"Clindamycin",
"Inhibit peptidyl transferase\nat 50S",
"S. aureus (not MRSA),\nStreptococcus, Anaerobes;\nNO Gram (−) coverage",
"C. difficile colitis,\nPseudomeningocele"],
["Chloramphenicol\n(Bacteriostatic)",
"Chloramphenicol",
"Inhibit peptidyl transferase\nat 50S",
"Broad: Gram (+), Gram (−),\nAnaerobes, Rickettsia,\nNeisseria meningitidis",
"Aplastic anaemia,\nGrey baby syndrome"],
["Oxazolidinones\n(Bacteriostatic)",
"Linezolid,\nTedizolid",
"Prevent formation of 70S\ninitiation complex",
"Gram (+) ONLY:\nMRSA, VRE, Streptococcus,\nSome Mycobacteria",
"Thrombocytopenia,\nSerotonin syndrome,\nOptic neuritis"],
["Streptogramins\n(Bactericidal in combo)",
"Quinupristin-Dalfopristin",
"Bind 50S — two agents\nblock sequential steps",
"Gram (+): S. aureus,\nStreptococcus,\nVRE (E. faecium only)",
"Myalgia,\nArthralgias"],
]
s50_tbl = mk_table(
["Class", "Key Drugs", "Mechanism", "Bacterial Spectrum", "Key Toxicities"],
s50_rows,
[3*cm, 3.5*cm, 3.5*cm, 4.5*cm, 2.5*cm],
DARK_RED, LIGHT_RED
)
story.append(s50_tbl)
story.append(Spacer(1, 8))
# ── PAGE BREAK ────────────────────────────────────────────────────
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════
# SECTION 4 — DNA / RNA SYNTHESIS INHIBITORS
# ══════════════════════════════════════════════════════════════════
story.append(section_header("IV. DNA / RNA Synthesis Inhibitors", ORANGE))
story.append(Spacer(1, 6))
dna_rows = [
["Fluoroquinolones\n(Bactericidal)",
"1st: Nalidixic acid\n2nd: Ciprofloxacin, Ofloxacin\n3rd: Levofloxacin\n4th: Moxifloxacin",
"Inhibit DNA gyrase\n(topoisomerase II) &\ntopoisomerase IV",
"1st: GNRs (urinary only)\n2nd: Broad GNRs incl. Pseudomonas\n3rd: GNRs + S. pneumoniae\n4th: GNRs + anaerobes\n(Moxifloxacin NOT Pseudomonas)",
"Tendinopathy, QTc,\nCNS effects, avoid\nin pregnancy/children"],
["Rifamycins\n(Bactericidal)",
"Rifampicin (Rifampin),\nRifabutin, Rifaximin",
"Inhibit bacterial\nDNA-dependent\nRNA polymerase",
"M. tuberculosis (combination),\nS. aureus (biofilm, combination),\nN. meningitidis prophylaxis,\nH. pylori (Rifabutin)",
"Orange discolouration,\nHepatic enzyme induction,\nRapid resistance if mono"],
["Nitroimidazoles\n(Bactericidal—anaerobes)",
"Metronidazole,\nTinidazole",
"Reduced to toxic free-radical\nintermediate under anaerobic\nconditions → DNA damage",
"Strict anaerobes:\nBacteroides fragilis,\nClostridium difficile,\nProtozoa: Giardia, Entamoeba,\nTrichomonas, H. pylori",
"Metallic taste,\nDisulfiram-like reaction\nwith alcohol,\nPeripheral neuropathy"],
["Nitrofurantoin\n(Bacteriostatic/cidal)",
"Nitrofurantoin",
"Inhibits multiple bacterial\nenzyme systems\n(requires high urinary conc.)",
"UTI pathogens only:\nE. coli, S. saprophyticus,\nEnterococcus faecalis",
"Pulmonary toxicity,\nneuropathy (prolonged use)"],
]
dna_tbl = mk_table(
["Class", "Key Drugs", "Mechanism", "Bacterial Spectrum", "Key Toxicities"],
dna_rows,
[3*cm, 3.5*cm, 3.5*cm, 4.5*cm, 2.5*cm],
ORANGE, LIGHT_ORANGE
)
story.append(dna_tbl)
story.append(Spacer(1, 8))
# ══════════════════════════════════════════════════════════════════
# SECTION 5 — FOLATE SYNTHESIS INHIBITORS
# ══════════════════════════════════════════════════════════════════
story.append(section_header("V. Folate Synthesis Inhibitors (Bacteriostatic)", GREEN))
story.append(Spacer(1, 6))
folate_rows = [
["Sulfonamides",
"Sulfamethoxazole,\nSulfadiazine, Dapsone",
"Competitive inhibit\nDihydropteroate synthase\n→ block PABA incorporation\ninto folic acid",
"Gram (+): S. pyogenes, S. pneumoniae,\nS. aureus (reduced)\nGram (−): Nocardia, Klebsiella granulomatis,\nH. ducreyi\nFungi/Parasites: Toxoplasma (sulfadiazine),\nPneumocystis jirovecii (dapsone)"],
["Trimethoprim",
"Trimethoprim (TMP)",
"Inhibit Dihydrofolate\nReductase → block\ntetrahydrofolate synthesis",
"Gram (+) and Gram (−);\nsynergistic with sulfonamides"],
["TMP-SMX\n(Co-trimoxazole)",
"Trimethoprim-\nSulfamethoxazole",
"Sequential blockade\nof folate pathway\n(synergistic effect)",
"E. coli, Staph, Streptococcus,\nH. influenzae, Pneumocystis jirovecii,\nNocardia, Toxoplasma,\nSalmonella, Shigella, Listeria"],
]
folate_tbl = mk_table(
["Drug / Class", "Examples", "Mechanism", "Bacterial & Pathogen Spectrum"],
folate_rows,
[3.5*cm, 4*cm, 4.5*cm, 5*cm],
GREEN, LIGHT_GREEN
)
story.append(folate_tbl)
story.append(Spacer(1, 8))
# ══════════════════════════════════════════════════════════════════
# SECTION 6 — CELL MEMBRANE DISRUPTORS
# ══════════════════════════════════════════════════════════════════
story.append(section_header("VI. Cell Membrane Disruptors (Bactericidal)", DARK_RED))
story.append(Spacer(1, 6))
membrane_rows = [
["Polymyxins",
"Colistin (Polymyxin E),\nPolymyxin B",
"Bind LPS in outer membrane\nof GNRs → membrane\ndisruption → cell lysis",
"Last-resort GNRs:\nAcinetobacter baumannii,\nPseudomonas aeruginosa, CRE\n(Carbapenem-Resistant Enterobacteriaceae)",
"Nephrotoxicity (dose-limiting),\nneurotoxicity, reserved\nfor pan-resistant GNRs"],
["Daptomycin",
"Daptomycin",
"Calcium-dependent insertion\ninto Gram (+) membrane\n→ depolarisation → cell death",
"Gram (+) ONLY:\nS. aureus (MRSA ✓),\nStreptococcus, VRE,\nEnterococcus",
"Myopathy/CPK elevation,\nInactivated by lung\nsurfactant — NOT for pneumonia"],
]
membrane_tbl = mk_table(
["Drug Class", "Drugs", "Mechanism", "Bacterial Spectrum", "Key Considerations"],
membrane_rows,
[3*cm, 3.5*cm, 3.5*cm, 4*cm, 3*cm],
DARK_RED, LIGHT_RED
)
story.append(membrane_tbl)
story.append(Spacer(1, 8))
# ── PAGE BREAK ────────────────────────────────────────────────────
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════
# SECTION 7 — SUMMARY SPECTRUM TABLE
# ══════════════════════════════════════════════════════════════════
story.append(section_header("VII. Summary Spectrum at a Glance", NAVY))
story.append(Spacer(1, 6))
def tick(val, pos_color=GREEN, neg_color=DARK_RED):
return val # just text in the table
TICK = "✓✓"
TICK1 = "✓"
CROSS = "—"
SYNERGY = "Synergy"
spec_headers = ["Antibiotic Class", "Gram (+)", "Gram (−)", "Anaerobes", "Atypicals", "Mycobacteria"]
spec_rows = [
["Penicillin G/V", "✓✓", "Limited", "Some", "—", "—"],
["Aminopenicillins", "✓", "Limited", "—", "—", "—"],
["Antipseudomonal PCN", "✓", "✓✓ + Pseudo","✓", "—", "—"],
["1st-gen Cephalosporins", "✓", "Limited", "—", "—", "—"],
["3rd-gen Cephalosporins", "✓", "✓✓", "—", "—", "—"],
["Carbapenems", "✓", "✓✓ Broadest","✓✓", "—", "—"],
["Vancomycin", "✓✓ MRSA","—", "—", "—", "—"],
["Aminoglycosides", "Synergy","✓✓", "—", "—", "Streptomycin"],
["Tetracyclines", "✓", "✓", "Some", "✓✓", "—"],
["Macrolides", "✓", "Limited", "—", "✓✓", "Some"],
["Fluoroquinolones (2nd)", "Limited","✓✓ + Pseudo","—", "—", "—"],
["Fluoroquinolones (3–4th)", "✓", "✓✓", "4th only","—", "—"],
["Metronidazole", "—", "—", "✓✓", "—", "—"],
["TMP-SMX", "✓", "✓", "—", "Some", "—"],
["Rifampicin", "✓", "—", "—", "—", "✓✓"],
["Polymyxins", "—", "✓✓ Resistant","—", "—", "—"],
["Linezolid", "✓✓ MRSA","—", "—", "—", "Some"],
["Daptomycin", "✓✓ MRSA","—", "—", "—", "—"],
]
# Build with colour coding per cell
spec_data = [[Paragraph(h, cell_head) for h in spec_headers]]
for row in spec_rows:
styled = [Paragraph(row[0], cell_bold)]
for val in row[1:]:
if "✓✓" in val:
style = ParagraphStyle("pos2", fontName="Helvetica-Bold", fontSize=7.5,
textColor=HexColor("#1B5E20"), alignment=TA_CENTER, leading=10)
elif "✓" in val:
style = ParagraphStyle("pos1", fontName="Helvetica", fontSize=7.5,
textColor=HexColor("#2E7D32"), alignment=TA_CENTER, leading=10)
elif val == "—":
style = ParagraphStyle("neg", fontName="Helvetica", fontSize=7.5,
textColor=HexColor("#9E9E9E"), alignment=TA_CENTER, leading=10)
else:
style = ParagraphStyle("note", fontName="Helvetica-Oblique", fontSize=7.5,
textColor=HexColor("#4A148C"), alignment=TA_CENTER, leading=10)
styled.append(Paragraph(val, style))
spec_data.append(styled)
spec_tbl = Table(spec_data, colWidths=[4*cm, 2.5*cm, 2.5*cm, 2.3*cm, 2.3*cm, 3.4*cm])
spec_style = [
("BACKGROUND", (0,0), (-1,0), NAVY),
("GRID", (0,0), (-1,-1), 0.4, MID_GREY),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_NAVY]),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]
spec_tbl.setStyle(TableStyle(spec_style))
story.append(spec_tbl)
story.append(Spacer(1, 8))
# ══════════════════════════════════════════════════════════════════
# SECTION 8 — ANTI-MYCOBACTERIAL & SPECIAL AGENTS
# ══════════════════════════════════════════════════════════════════
story.append(section_header("VIII. Anti-Mycobacterial Agents (Special Class)", DARK_BLUE))
story.append(Spacer(1, 6))
myco_rows = [
["Isoniazid (INH)", "Inhibit mycolic acid synthesis (InhA)", "M. tuberculosis (1st-line)", "Peripheral neuropathy, hepatitis"],
["Rifampicin", "Inhibit RNA polymerase", "M. tuberculosis, M. leprae (combination)","Orange secretions, hepatitis, drug interactions"],
["Pyrazinamide (PZA)", "Unknown — active in acidic environment","M. tuberculosis (1st-line, sterilising)", "Hyperuricaemia, hepatotoxicity"],
["Ethambutol (EMB)", "Inhibit arabinosyl transferase\n(arabinogalactan synthesis)",
"M. tuberculosis (1st-line)", "Optic neuritis (dose/duration-dependent)"],
["Streptomycin", "Inhibit 30S ribosome", "M. tuberculosis (2nd-line),\nM. avium complex","Ototoxicity, nephrotoxicity"],
["Dapsone", "Inhibit dihydropteroate synthase\n(like sulfonamides)",
"M. leprae (leprosy),\nPneumocystis jirovecii (PCP prophylaxis)", "Haemolytic anaemia (G6PD), methaemoglobinaemia"],
]
myco_tbl = mk_table(
["Drug", "Mechanism", "Target Organisms", "Key Toxicities"],
myco_rows,
[3.5*cm, 5*cm, 5*cm, 3.5*cm],
DARK_BLUE, LIGHT_BLUE
)
story.append(myco_tbl)
story.append(Spacer(1, 6))
# ── FOOTER note ───────────────────────────────────────────────────
story.append(HRFlowable(width="100%", thickness=1, color=MID_GREY))
story.append(Spacer(1, 4))
story.append(Paragraph(
"Sources: Goodman & Gilman's The Pharmacological Basis of Therapeutics (Chapter: Antimicrobial Chemotherapy: Classes and Actions) • "
"Campbell-Walsh Urology Tables 55.4–55.6 • Katzung's Basic and Clinical Pharmacology, 16th Edition",
note_style))
# ── BUILD ─────────────────────────────────────────────────────────
doc.build(story)
print("PDF generated:", OUTPUT)
cd /home/daytona/workspace/antibiotics-pdf && python generate_pdf.py 2>&1
ls -lh /home/daytona/workspace/antibiotics-pdf/Antibiotic_Classification.pdf
Antibiotic Classification
PDF Document · PDF
| Section | Content |
|---|---|
| I | Bactericidal vs Bacteriostatic — side-by-side colour table (blue/teal) |
| II | β-Lactams full subclass table (penicillins → carbapenems) + Glycopeptides |
| III | 30S inhibitors (aminoglycosides, tetracyclines) + 50S inhibitors (macrolides, linezolid, clindamycin, etc.) |
| IV | DNA/RNA inhibitors — fluoroquinolones, rifamycins, metronidazole, nitrofurantoin |
| V | Folate inhibitors — sulfonamides, TMP, TMP-SMX |
| VI | Cell membrane disruptors — polymyxins, daptomycin |
| VII | Master spectrum table (18 drug classes × 5 coverage categories, colour-coded ✓✓/✓/—) |
| VIII | Anti-mycobacterial agents — INH, rifampicin, PZA, EMB, streptomycin, dapsone |