Panchavidha Kashaya Kalpana and their Modern Correlation
Panchavidha Kashaya Kalpana five classical Ayurvedic dosage forms modern correlation
https://pdfs.semanticscholar.org/fa29/29ed80e8ba483799860ffd…
Ayurvedic Kashaya decoction herbal dosage form standardization
Panchavidha Kashaya Kalpana Swarasa Kalka Kwatha Hima Phanta preparation method dose potency modern equivalent
https://www.wjpls.org/admin/assets/article_issue/78042022/16…
"Swarasah Kalkah Shrutah Himah Phanta iti tesham yathapoorvam Baladhikyam" (Charaka Samhita, Sutrasthana 4/6)
| Rank | Preparation | Potency | Quality |
|---|---|---|---|
| 1st | Swarasa | Highest - Guru (heavy) | Most potent |
| 2nd | Kalka | High | Complete fractions |
| 3rd | Kwatha | Moderate | Water-soluble, heat-stable |
| 4th | Hima | Lower | Thermolabile, volatile |
| 5th | Phanta | Lowest - Laghu (light) | Mildest |
| Prakshepa Dravya | Modern Understanding |
|---|---|
| Madhu (Honey) | Hygroscopic carrier; contains enzymes, improves bioavailability |
| Sharkara (Sugar) | Energy source; improves palatability |
| Saindhava Lavana (Rock Salt) | Electrolyte; improves absorption |
| Ghrita (Clarified butter) | Lipophilic carrier for fat-soluble phytochemicals |
| Takra (Buttermilk) | Probiotic medium; improves gut absorption |
| Parameter | Swarasa | Kalka | Kwatha | Hima | Phanta |
|---|---|---|---|---|---|
| Drug form | Fresh/Dried | Powder/Fresh | Coarse powder | Coarse powder | Coarse powder |
| Medium | No external water | Minimal water | Water (boiling) | Cold water | Hot (not boiling) water |
| Drug:Water | - | - | 1:4/8/16 | 1:3 | - |
| Reduction | - | - | To 1/4th | No reduction | No reduction |
| Temperature | Cold/Room | Room | Boiling (100°C) | Cold/Room | Hot (~80-90°C) |
| Dose | 30 ml | 5-10 g | 40 ml | 48 ml | 96 g |
| Shelf life | Immediate | Immediate | Immediate | Immediate | Immediate |
| Ayurvedic Kalpana | Modern Pharmaceutical Equivalent | Modern Process |
|---|---|---|
| Swarasa | Expressed Juice / Fresh Plant Juice | Expression - liquid separated from solid by mechanical force (pressing, centrifugation). Includes fruit juices, fresh plant extracts. |
| Kalka | Paste / Pulp / Macerate | Simple comminution; corresponds to crude drug pastes, whole-herb preparations used in phytotherapy. |
| Kwatha | Decoction / Aqueous Extract | Aqueous extraction by prolonged boiling - the standard pharmacopoeial decoction (British Pharmacopoeia, USP). Modern equivalents also include concentrated herbal extracts, Ghanavati = dry extract granules. |
| Hima | Cold Infusion / Cold Maceration | Cold maceration in modern pharmacy - used for thermolabile and volatile-rich herbs. Corresponds to cold-process tinctures and cold-water extracts. |
| Phanta | Hot Infusion / Herbal Tea Infusion | Infusion by steeping in hot but not boiling water - identical to standard tea/tisane preparation. The British Pharmacopoeia's "Infusion" method. |
| Primary Kalpana | Derived Upakalpanas | Modern Pharmaceutical Parallel |
|---|---|---|
| Swarasa | Rasakriya, Avaleha | Concentrated syrups, electuaries |
| Kalka | Churna, Vatika/Gutika (pills), Lepa, Upanaha | Powders, tablets, external patches |
| Kwatha | Ghanavati, Vati, Asava-Arista, Sneha Kalpana, Avaleha, Kshirapaka | Dry extracts, tablets, fermented tinctures, medicated oils, linctus |
| Hima | Mantha, Tandulodaka, Panaka | Cold-process tinctures, medicated waters |
| Phanta | Sharkara | Herbal syrups |
| Kalpana | Best for Dosha | Rationale |
|---|---|---|
| Swarasa | Pitta, Kapha | Most potent, heavy - suited for strong Agni |
| Kalka | Vata, Kapha | Complete drug substance |
| Kwatha | Vata, Kapha | Warm, aqueous; penetrating |
| Hima | Pitta | Cold potency, cooling effect |
| Phanta | Kapha, Vata | Light, warm; carminative |
| S.No | Kalpana | Synonym | Method | Ratio | Dose | Modern Equivalent |
|---|---|---|---|---|---|---|
| 1 | Swarasa | Rasa, Niryas | Expression/squeezing | - | 30 ml | Expressed juice, Cold-press extract |
| 2 | Kalka | - | Grinding into paste | - | 5-10 g | Paste, Whole-herb preparation |
| 3 | Kwatha | Shrita, Kashayam | Boiling + reduction | 1:4/8/16 → 1/4th | 40 ml | Decoction, Aqueous extract |
| 4 | Hima | Sheeta Kashaya | Cold maceration | 1:3, 4-6 hours | 48 ml | Cold infusion, Cold maceration |
| 5 | Phanta | Churnadrava | Hot water steeping | - | 96 g | Hot infusion, Herbal tea/Tisane |
Generate a quick reference PDF guide for practitioners on when to use each Kalpana
ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace not found"
mkdir -p /home/daytona/workspace/kashaya-kalpana && python3 -c "import reportlab…
~/kashaya-kalpana/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether, PageBreak
)
from reportlab.graphics.shapes import Drawing, Rect, String, Line
from reportlab.graphics import renderPDF
from reportlab.pdfgen import canvas
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
# ─── Color Palette ────────────────────────────────────────────────────────────
DEEP_GREEN = colors.HexColor("#1B4332") # header / titles
MID_GREEN = colors.HexColor("#2D6A4F") # section headers
LIGHT_GREEN = colors.HexColor("#52B788") # accent lines
PALE_GREEN = colors.HexColor("#D8F3DC") # table header bg
CREAM = colors.HexColor("#FEFAE0") # card background
SAFFRON = colors.HexColor("#E76F00") # potency badge
AMBER = colors.HexColor("#F4A261") # highlight
DARK_TEXT = colors.HexColor("#1A1A1A")
MID_GREY = colors.HexColor("#555555")
LIGHT_GREY = colors.HexColor("#EEEEEE")
WHITE = colors.white
OUTPUT = "/home/daytona/workspace/kashaya-kalpana/Panchavidha_Kashaya_Kalpana_Quick_Reference.pdf"
# ─── Page Setup ───────────────────────────────────────────────────────────────
PAGE_W, PAGE_H = A4
MARGIN = 1.6 * cm
def make_doc():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=MARGIN,
rightMargin=MARGIN,
topMargin=MARGIN,
bottomMargin=1.8 * cm,
title="Panchavidha Kashaya Kalpana – Quick Reference Guide",
author="Ayurvedic Pharmaceutics",
subject="Quick reference for Ayurvedic practitioners",
)
return doc
# ─── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
TITLE_STYLE = S("Title",
fontName="Helvetica-Bold", fontSize=22, textColor=WHITE,
alignment=TA_CENTER, spaceAfter=4, leading=28)
SUBTITLE_STYLE = S("Subtitle",
fontName="Helvetica", fontSize=11, textColor=PALE_GREEN,
alignment=TA_CENTER, spaceAfter=2, leading=14)
SECTION_STYLE = S("Section",
fontName="Helvetica-Bold", fontSize=13, textColor=WHITE,
alignment=TA_LEFT, spaceBefore=4, spaceAfter=3, leading=16)
CARD_TITLE = S("CardTitle",
fontName="Helvetica-Bold", fontSize=12, textColor=DEEP_GREEN,
alignment=TA_LEFT, spaceAfter=3, leading=15)
CARD_BODY = S("CardBody",
fontName="Helvetica", fontSize=9, textColor=DARK_TEXT,
alignment=TA_LEFT, leading=13, spaceAfter=2)
CARD_BODY_J = S("CardBodyJ",
fontName="Helvetica", fontSize=9, textColor=DARK_TEXT,
alignment=TA_JUSTIFY, leading=13, spaceAfter=2)
SMALL_BOLD = S("SmallBold",
fontName="Helvetica-Bold", fontSize=8.5, textColor=MID_GREEN,
alignment=TA_LEFT, leading=12)
SMALL = S("Small",
fontName="Helvetica", fontSize=8.5, textColor=DARK_TEXT,
alignment=TA_LEFT, leading=12)
SMALL_J = S("SmallJ",
fontName="Helvetica", fontSize=8.5, textColor=DARK_TEXT,
alignment=TA_JUSTIFY, leading=12)
FOOTER_STYLE = S("Footer",
fontName="Helvetica-Oblique", fontSize=7.5, textColor=MID_GREY,
alignment=TA_CENTER)
BADGE_STYLE = S("Badge",
fontName="Helvetica-Bold", fontSize=8, textColor=WHITE,
alignment=TA_CENTER, leading=10)
# ─── Helper builders ──────────────────────────────────────────────────────────
def hline(color=LIGHT_GREEN, thickness=1.2, width="100%"):
return HRFlowable(width=width, thickness=thickness, color=color, spaceAfter=4, spaceBefore=4)
def section_banner(text):
"""Full-width dark green banner for a section heading."""
tbl = Table([[Paragraph(text, SECTION_STYLE)]], colWidths=[PAGE_W - 2*MARGIN])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), MID_GREEN),
("ROUNDEDCORNERS", [4]),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
]))
return tbl
def potency_pill(rank, label):
"""Colored pill showing potency rank."""
colors_map = {1: SAFFRON, 2: colors.HexColor("#E07020"),
3: MID_GREEN, 4: colors.HexColor("#4895EF"),
5: colors.HexColor("#7B7B7B")}
col = colors_map.get(rank, MID_GREEN)
inner = Table([[Paragraph(f"Potency #{rank} — {label}", BADGE_STYLE)]],
colWidths=[4.5*cm])
inner.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), col),
("ROUNDEDCORNERS", [8]),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
]))
return inner
def kalpana_card(data):
"""
data keys: rank, name, sanskrit, synonym, method, drug_ratio, temperature,
dose, modern_equiv, use_when, avoid_when, dosha, examples, upakalpanas
"""
available_w = PAGE_W - 2*MARGIN
# --- Top row: pill + name + synonym
top_left = [
potency_pill(data["rank"], data["name"]),
Spacer(1, 4),
Paragraph(f'<b><font size="14" color="#1B4332">{data["name"]}</font></b>'
f' <font size="10" color="#555">{data["sanskrit"]}</font>', CARD_BODY),
Paragraph(f'Synonym: {data["synonym"]}', SMALL),
]
top_right_text = (
f'<b>Modern Equivalent:</b> {data["modern_equiv"]}<br/>'
f'<b>Dosha Indicated:</b> {data["dosha"]}<br/>'
f'<b>Temperature:</b> {data["temperature"]}<br/>'
f'<b>Dose:</b> {data["dose"]}'
)
top_right = [Paragraph(top_right_text, SMALL)]
top_tbl = Table(
[[top_left, top_right]],
colWidths=[available_w * 0.48, available_w * 0.48],
)
top_tbl.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
]))
# --- Method row
method_row = Paragraph(f"<b>Preparation:</b> {data['method']}", SMALL_J)
# --- Use when / Avoid when
use_avoid = Table(
[[
[Paragraph("<b>USE WHEN</b>", SMALL_BOLD)] +
[Paragraph(f"• {u}", SMALL) for u in data["use_when"]],
[Paragraph("<b>AVOID / CAUTION WHEN</b>", SMALL_BOLD)] +
[Paragraph(f"• {a}", SMALL) for a in data["avoid_when"]],
]],
colWidths=[available_w * 0.48, available_w * 0.48],
)
use_avoid.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("BACKGROUND", (0,0), (0,0), colors.HexColor("#EBF9F1")),
("BACKGROUND", (1,0), (1,0), colors.HexColor("#FFF3E0")),
("ROUNDEDCORNERS", [4]),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
]))
# --- Examples + Upakalpanas
eg_text = "<b>Clinical Examples:</b> " + "; ".join(data["examples"])
upa_text = "<b>Upakalpanas (derived forms):</b> " + ", ".join(data["upakalpanas"])
# Wrap everything in a card table
card_content = [
top_tbl,
Spacer(1, 5),
method_row,
Spacer(1, 5),
use_avoid,
Spacer(1, 5),
Paragraph(eg_text, SMALL_J),
Paragraph(upa_text, SMALL_J),
]
card = Table([[card_content]], colWidths=[available_w])
card.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), CREAM),
("BOX", (0,0), (-1,-1), 1.2, LIGHT_GREEN),
("ROUNDEDCORNERS", [6]),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
]))
return card
# ─── Data ─────────────────────────────────────────────────────────────────────
KALPANAS = [
dict(
rank=1,
name="Swarasa",
sanskrit="(स्वरस)",
synonym="Rasa, Niryas",
method=(
"Fresh plant material is washed, pounded in a stone mortar/pestle, "
"and squeezed through a clean cloth to yield raw juice. "
"For dry drugs: soak overnight in water, then express. "
"Use immediately — no heating."
),
drug_ratio="No water addition for fresh drug",
temperature="Room temperature / Cold (no heat)",
dose="30 ml (½ Pala) — most potent, so smallest effective volume",
modern_equiv="Expressed Juice / Cold-Press Extract",
dosha="Pitta, Kapha (high potency, Guru — heavy)",
use_when=[
"Patient has strong Agni (digestive fire) and good strength (Bala)",
"Acute conditions needing rapid action",
"Drugs with water- and heat-labile active principles",
"When maximum bioavailability of all phytoconstituents is needed",
"Fresh seasonal herbs readily available",
"Conditions: Jwara (fever), Arsha (piles), Prameha (diabetes), Rakta-Pitta",
],
avoid_when=[
"Weak patients, elderly, children (Guru — heavy to digest)",
"Mandagni (low digestive capacity)",
"Unavailability of fresh herbs",
"Dry, hard, or resinous drugs (use Kwatha instead)",
"Vata predominant conditions (too cold and heavy)",
],
examples=[
"Tulsi Swarasa — cough, cold, respiratory infections",
"Guduchi Swarasa — fever, cardiac tonic",
"Adraka Swarasa — nausea, indigestion",
"Nimba Swarasa — skin disorders, worm infestation",
],
upakalpanas=["Rasakriya (concentrated solid extract)", "Avaleha (linctus/jam)"],
),
dict(
rank=2,
name="Kalka",
sanskrit="(कल्क)",
synonym="Fine Paste, Mardita",
method=(
"Drug material (fresh or dried) is ground with a small quantity of water "
"on a stone slab (shila) to a smooth, homogeneous paste — not too wet, "
"not too dry. Used internally or externally."
),
drug_ratio="Minimal water to achieve paste consistency",
temperature="Room temperature",
dose="5–10 g (1 Pala) — complete drug substance preserved",
modern_equiv="Whole-Herb Paste / Soft Extract (Extractum Molle)",
dosha="Vata, Kapha; balanced across Doshas",
use_when=[
"Complete drug fraction required (water- AND oil-soluble constituents)",
"External applications: skin diseases, wounds, poultices (Lepa/Upanaha)",
"Preparation of Gutika/Vatika (pills) as base",
"Anthelmintic purpose (e.g., Nimba Kalka)",
"When cooking/heating would denature key constituents",
"Drugs with resinous, oily, or waxy components not extractable by water",
],
avoid_when=[
"Conditions requiring rapid systemic absorption (use Swarasa or Kwatha)",
"Drugs with objectionable taste that cannot be masked in paste form",
"Bulky fibrous materials (difficult to grind uniformly)",
"Patients unable to swallow pastes (use liquid forms)",
],
examples=[
"Nimba (Neem) Kalka — intestinal worms, skin infections",
"Haritaki Kalka — bowel regulation, constipation",
"Chandana Kalka — external application in Pitta-driven skin disorders",
"Yashtimadhu Kalka — ulcers, wound healing",
],
upakalpanas=[
"Churna (powder)", "Vatika/Gutika (pills/tablets)",
"Lepa (external paste)", "Pralepa", "Upanaha (poultice)", "Pramathya"
],
),
dict(
rank=3,
name="Kwatha",
sanskrit="(क्वाथ / श्रित)",
synonym="Shrita, Kashayam, Niryuha",
method=(
"Coarsely powdered drug is added to water in ratio 1:16 (soft), 1:8 (medium), "
"or 1:4 (hard) and boiled open-pan until reduced to 1/4th original volume. "
"Filter hot through cloth. Consume warm. "
"'Supachita Kwatha' must have proper smell, color, and taste of the herb."
),
drug_ratio="1:4 (hard) / 1:8 (medium) / 1:16 (soft) → reduce to 1/4th",
temperature="Boiling (100°C)",
dose="40 ml (2 Pala) — most widely prescribed form",
modern_equiv="Decoction / Aqueous Extract / Herbal Tea Bag Concentrate",
dosha="Vata, Kapha (warm, penetrating, drying)",
use_when=[
"Hard, woody, or bark-based drugs (best extraction by prolonged boiling)",
"Water-soluble, HEAT-STABLE active compounds (alkaloids, glycosides, tannins)",
"Chronic Vata and Kapha disorders: arthritis, respiratory, neurological",
"Post-partum care (e.g., Dashamula Kwatha)",
"Panchakarma preparatory therapies (Snehana, Svedana)",
"Whenever standardized aqueous extraction is appropriate",
"Manufacturing base for Asava-Arista, Avaleha, Ghanavati",
],
avoid_when=[
"Drugs with thermolabile / volatile active principles (use Hima or Phanta)",
"Fragrant aromatic herbs where volatile oils are the intended active (use Phanta)",
"Acute Pitta disorders — hot decoction aggravates Pitta",
"Haemorrhagic conditions (Raktapitta) — may increase heat",
"Very weak patients who cannot handle concentrated decoctions",
],
examples=[
"Dashamula Kwatha — post-partum recovery, pain, Vata",
"Triphala Kwatha — bowel detox, eye wash",
"Panchakola Kwatha — digestive disorders",
"Punarnava Kwatha — oedema, kidney support",
],
upakalpanas=[
"Ghanavati (dry concentrated extract)", "Vati/Tablets",
"Asava-Arista (fermented)", "Sneha Kalpana (medicated oils/ghee)",
"Avaleha", "Kshirapaka", "Gandusa/Kavala (mouth rinses)",
"Netra Kalpa (eye drops)", "Nasa Kalpa (nasal drops)"
],
),
dict(
rank=4,
name="Hima",
sanskrit="(हिम / शीत कषाय)",
synonym="Sheeta Kashaya, Cold Infusion",
method=(
"1 part coarsely powdered drug is soaked in 3 parts cold water "
"for 4–6 hours (or overnight for some texts). "
"Rub gently and filter through cloth. Administer immediately at room temperature."
),
drug_ratio="Drug 1 : Water 3 (cold soak, 4–6 hours)",
temperature="Room temperature / Cold (no heat applied)",
dose="48 ml (1 Pala) — use immediately",
modern_equiv="Cold Infusion / Cold Maceration (Infusum Frigidum)",
dosha="Pitta (cooling, Sheeta Virya)",
use_when=[
"Drugs with Sheeta Virya (cold potency) — heat would negate their action",
"Volatile, fragrant, aromatic herbs with thermolabile active principles",
"Pitta-aggravated conditions: Daha (burning), Trishna (excessive thirst), Raktapitta",
"Inflammatory conditions, fever (Pitta-type Jwara)",
"Drugs rich in tannins where boiling causes excessive astringency",
"When a cooling, light preparation is specifically indicated",
],
avoid_when=[
"Kapha disorders — cold preparations aggravate Kapha (use Phanta or Kwatha)",
"Vata disorders — cold quality worsens Vata",
"Patients with low immunity or digestive weakness (Mandagni)",
"Hard, woody, or resinous drugs (active principles not released by cold water)",
"Winter season or cold climates without clinical justification",
],
examples=[
"Chandana Hima — burning sensations, Pitta fever, urinary disorders",
"Dhanyaka (Coriander) Hima — cooling digestive, Pitta dyspepsia",
"Ushira (Vetiver) Hima — excessive body heat, skin rashes",
"Musta Hima — Pitta-type diarrhea",
],
upakalpanas=["Mantha (stirred drink)", "Tandulodaka (rice water)", "Panaka (herbal drink)"],
),
dict(
rank=5,
name="Phanta",
sanskrit="(फाण्ट)",
synonym="Churnadrava, Hot Infusion",
method=(
"Coarsely powdered drug is placed in a vessel and hot (not boiling) water "
"is poured over it. Vessel is removed from fire. Allow to steep a few minutes, "
"rub gently, filter, and administer warm. Similar to preparing a cup of herbal tea."
),
drug_ratio="Drug in hot water — steep, rub, filter",
temperature="Hot water (~80–90°C, not boiling)",
dose="96 g (2 Pala) — lightest, largest volume; use immediately",
modern_equiv="Hot Infusion / Tisane / Herbal Tea (Green Tea Method)",
dosha="Kapha, Vata (light, warm, penetrating but not heavy)",
use_when=[
"Fragrant, aromatic drugs whose volatile oils must NOT be boiled off",
"Light-structured drugs (flowers, leaves, thin stems) with delicate active principles",
"Kapha and Vata disorders requiring a warm, light preparation",
"Digestive stimulant use: carminatives, aromatics",
"Patients who cannot tolerate the heavy Swarasa or concentrated Kwatha",
"Quick bedside preparation with minimal equipment",
"Drugs where boiling causes loss of volatile oil but cold soaking is inadequate",
],
avoid_when=[
"Hard, dense, woody, bark drugs — insufficient extraction by hot soak alone (use Kwatha)",
"Pitta disorders — warm nature may aggravate Pitta",
"Drugs requiring prolonged high-temperature extraction",
"Situations where a larger volume (96 g) is impractical for the patient",
],
examples=[
"Peppermint / Pudina Phanta — digestive carminative, bloating",
"Lavanga (Clove) Phanta — respiratory Kapha, cold",
"Jatiphala (Nutmeg) Phanta — Vata diarrhea, insomnia",
"Shunthi (Dry ginger) Phanta — Vata-Kapha cold, nausea",
],
upakalpanas=["Sharkara (herbal sugar preparation)"],
),
]
# ─── Quick Decision Table Data ────────────────────────────────────────────────
DECISION_TABLE_HEADER = [
Paragraph("<b>Clinical Scenario</b>", SMALL_BOLD),
Paragraph("<b>Recommended Kalpana</b>", SMALL_BOLD),
Paragraph("<b>Reason</b>", SMALL_BOLD),
]
DECISION_TABLE_ROWS = [
["Acute Pitta fever, burning sensation", "Hima", "Cooling, Sheeta Virya preserved"],
["Post-partum Vata imbalance, body pain", "Kwatha (Dashamula)", "Warm, Vata-pacifying decoction"],
["Kapha cough with aromatic herbs (Pudina)", "Phanta", "Volatile oils preserved in hot infusion"],
["Intestinal worm infestation (external/internal)", "Kalka (Nimba)", "Complete whole-herb fraction"],
["Strong patient, acute infection, rapid action needed", "Swarasa", "Highest potency, fastest action"],
["Chronic arthritis, woody/bark-based formula", "Kwatha", "Prolonged boiling extracts hard drugs"],
["Urinary burning (Raktapitta)", "Hima (Chandana/Ushira)", "Cold potency, Pitta-pacifying"],
["Digestive carminative (Ajwain, Clove, Ginger)", "Phanta", "Aromatic volatiles released without boiling"],
["Manufacturing base for Asava-Arista", "Kwatha", "Fermented preparations derived from Kwatha"],
["Elderly / weak patient, mild therapy", "Phanta or Hima", "Lightest (Laghu) preparations"],
["External wound dressing / poultice", "Kalka (Lepa/Upanaha)", "Paste form for topical use"],
["Pitta skin disorder, topical cooling", "Kalka or Hima (Chandana)", "Direct contact + cooling"],
["Panchakarma Snehana (oleation) base", "Kwatha", "Sneha Kalpana derived from Kwatha base"],
["Respiratory Kapha (congestion, thick mucus)", "Kwatha or Phanta", "Warm + penetrating quality"],
]
def build_decision_table():
available_w = PAGE_W - 2 * MARGIN
rows = [DECISION_TABLE_HEADER]
for scenario, kalpana, reason in DECISION_TABLE_ROWS:
rows.append([
Paragraph(scenario, SMALL),
Paragraph(f"<b>{kalpana}</b>", SMALL_BOLD),
Paragraph(reason, SMALL),
])
tbl = Table(rows, colWidths=[available_w*0.38, available_w*0.22, available_w*0.38],
repeatRows=1)
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DEEP_GREEN),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
("BACKGROUND", (1,1), (1,-1), colors.HexColor("#F0FFF4")),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 7),
("RIGHTPADDING", (0,0), (-1,-1), 7),
("VALIGN", (0,0), (-1,-1), "TOP"),
("ALIGN", (1,0), (1,-1), "CENTER"),
]))
return tbl
# ─── Comparison Summary Table ─────────────────────────────────────────────────
def build_summary_table():
available_w = PAGE_W - 2 * MARGIN
headers = ["Kalpana", "Potency", "Temp", "Drug:Water", "Dose", "Dosha", "Modern Equivalent"]
rows_data = [
["Swarasa", "#1 Highest\n(Guru)", "Cold", "—", "30 ml", "Pitta,\nKapha", "Expressed Juice"],
["Kalka", "#2 High", "Room", "Minimal", "5–10 g", "Vata,\nKapha", "Whole-herb Paste"],
["Kwatha", "#3 Moderate", "Boiling\n100°C", "1:4/8/16\n→1/4th", "40 ml", "Vata,\nKapha", "Decoction"],
["Hima", "#4 Mild", "Cold\nRoom", "1:3\n(4–6 hrs)", "48 ml", "Pitta", "Cold Infusion"],
["Phanta", "#5 Lowest\n(Laghu)", "Hot\n~85°C", "Steep\n& strain", "96 g", "Kapha,\nVata", "Hot Infusion\n(Herbal Tea)"],
]
all_rows = [[Paragraph(f"<b>{h}</b>", SMALL_BOLD) for h in headers]]
for row in rows_data:
all_rows.append([Paragraph(c, SMALL) for c in row])
col_w = [available_w*0.12, available_w*0.12, available_w*0.10,
available_w*0.12, available_w*0.08, available_w*0.10, available_w*0.20]
# adjust to fill
col_w[-1] = available_w - sum(col_w[:-1])
tbl = Table(all_rows, colWidths=col_w, repeatRows=1)
row_colors = [
colors.HexColor("#FFF3CD"), # swarasa - amber
colors.HexColor("#E9F5E9"), # kalka - green
colors.HexColor("#E3F2FD"), # kwatha - blue
colors.HexColor("#FFF8F0"), # hima - cream
colors.HexColor("#F5F0FF"), # phanta - lavender
]
style = [
("BACKGROUND", (0,0), (-1,0), DEEP_GREEN),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ALIGN", (0,0), (-1,-1), "CENTER"),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
]
for i, rc in enumerate(row_colors):
style.append(("BACKGROUND", (0, i+1), (-1, i+1), rc))
tbl.setStyle(TableStyle(style))
return tbl
# ─── Prakshepa Dravya Table ───────────────────────────────────────────────────
def build_prakshepa_table():
available_w = PAGE_W - 2 * MARGIN
headers = ["Prakshepa Dravya", "Added To", "Purpose", "Modern Parallel"]
rows = [
["Madhu (Honey)", "All Kalpanas", "Palatability, hygroscopic carrier, enzyme activity", "Enzyme-enhanced carrier, natural preservative"],
["Sharkara (Sugar)", "All Kalpanas", "Palatability, energy, mild Pitta-pacifying", "Syrup base / excipient"],
["Saindhava Lavana", "Swarasa, Kwatha", "Electrolyte, improves absorption, Tridosha-pacifying", "Sodium chloride for bioavailability"],
["Ghrita (Ghee)", "Kalka, Kwatha", "Lipophilic carrier for fat-soluble phytochemicals", "Lipid-based drug delivery"],
["Takra (Buttermilk)", "Kwatha", "Probiotic medium, improves gut absorption", "Probiotic co-administration"],
["Jiraka (Cumin)", "Swarasa, Kalka", "Carminative, improves palatability and digestion", "Digestive enzyme support"],
]
all_rows = [[Paragraph(f"<b>{h}</b>", SMALL_BOLD) for h in headers]]
for row in rows:
all_rows.append([Paragraph(c, SMALL) for c in row])
col_w = [available_w*0.18, available_w*0.15, available_w*0.35, available_w*0.28]
col_w[-1] = available_w - sum(col_w[:-1])
tbl = Table(all_rows, colWidths=col_w, repeatRows=1)
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), MID_GREEN),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#CCCCCC")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
return tbl
# ─── Cover Header ─────────────────────────────────────────────────────────────
def build_cover_header():
available_w = PAGE_W - 2 * MARGIN
inner = [
Paragraph("PANCHAVIDHA KASHAYA KALPANA", TITLE_STYLE),
Paragraph("Quick Reference Guide for Ayurvedic Practitioners", SUBTITLE_STYLE),
Paragraph("Five Classical Pharmaceutical Preparations — Indications, Selection & Modern Correlation",
S("Sub2", fontName="Helvetica", fontSize=9, textColor=PALE_GREEN,
alignment=TA_CENTER, leading=13)),
]
tbl = Table([inner], colWidths=[available_w])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DEEP_GREEN),
("ROUNDEDCORNERS", [8]),
("TOPPADDING", (0,0), (-1,-1), 18),
("BOTTOMPADDING", (0,0), (-1,-1), 18),
("LEFTPADDING", (0,0), (-1,-1), 20),
("RIGHTPADDING", (0,0), (-1,-1), 20),
]))
return tbl
# ─── Intro blurb ──────────────────────────────────────────────────────────────
INTRO_TEXT = (
"Panchavidha Kashaya Kalpana (पञ्चविध कषाय कल्पन) are the five primary pharmaceutical "
"dosage forms of Ayurveda, first described by Acharya Charaka (Ch.Su. 4/6) and elaborated "
"by Acharya Sharangadhara. The word <i>Kashaya</i> means 'that which distorts the original "
"form of the drug and makes it suitable for use.' Each preparation is designed for a specific "
"drug type and patient condition. Potency decreases from Swarasa (#1) to Phanta (#5): "
"<i>'Swarasah Kalkah Shrutah Himah Phantakou — tesham yathapoorvam Baladhikyam'</i> "
"(each preceding form is more potent than the next). "
"Selection is guided by Roga (disease), Rogibala (patient strength), Agni (digestive fire), "
"Prakriti (constitution), Satmya (habituation), and Kala (season/time)."
)
# ─── Build Document ───────────────────────────────────────────────────────────
def build_story():
story = []
available_w = PAGE_W - 2 * MARGIN
# Cover header
story.append(build_cover_header())
story.append(Spacer(1, 10))
# Intro
story.append(Paragraph(INTRO_TEXT,
S("Intro", fontName="Helvetica", fontSize=9, textColor=DARK_TEXT,
alignment=TA_JUSTIFY, leading=14, spaceAfter=4)))
story.append(hline())
story.append(Spacer(1, 4))
# ── Summary Comparison Table
story.append(KeepTogether([
section_banner("AT A GLANCE: The Five Preparations Compared"),
Spacer(1, 6),
build_summary_table(),
Spacer(1, 4),
]))
story.append(Spacer(1, 8))
# ── Individual Kalpana Cards
story.append(section_banner("DETAILED PROFILES: Indications & Selection Criteria"))
story.append(Spacer(1, 6))
for k in KALPANAS:
story.append(KeepTogether([
kalpana_card(k),
Spacer(1, 8),
]))
# ── Quick Decision Table
story.append(PageBreak())
story.append(build_cover_header())
story.append(Spacer(1, 8))
story.append(KeepTogether([
section_banner("CLINICAL DECISION TABLE: Which Kalpana to Choose?"),
Spacer(1, 6),
build_decision_table(),
Spacer(1, 8),
]))
# ── Prakshepa Dravya
story.append(KeepTogether([
section_banner("PRAKSHEPA DRAVYA: Adjuvants and Their Rationale"),
Spacer(1, 6),
build_prakshepa_table(),
Spacer(1, 8),
]))
# ── Key Principles box
principles = [
"<b>Guruta-Laghuta principle:</b> Swarasa is Guru (heavy), Phanta is Laghu (light). "
"Select lighter forms for weaker patients and heavier forms for robust patients.",
"<b>Drug hardness:</b> Soft drugs (flowers, leaves) → Swarasa/Phanta. "
"Medium drugs (seeds, roots) → Kalka/Kwatha. Hard drugs (bark, wood, minerals) → Kwatha.",
"<b>Thermolability:</b> Volatile aromatic drugs → Hima (cold) or Phanta (hot-not-boiling). "
"Thermostable drugs → Kwatha (full boiling).",
"<b>Dosha guide:</b> Pitta aggravation → Hima. Vata/Kapha → Kwatha/Phanta. "
"Acute strong disease → Swarasa. Chronic mild disease → Phanta/Hima.",
"<b>Shelf life:</b> All five are freshly prepared and consumed immediately. "
"Modern Upakalpanas (Ghanavati, granules, tablets) extend shelf life while preserving principles.",
"<b>Upakalpana selection:</b> Kwatha is the richest source of secondary formulations — "
"Asava-Arista, Sneha Kalpana, Vati, and Avaleha are all Kwatha-derived.",
]
principle_items = [Paragraph("KEY PRESCRIBING PRINCIPLES", SECTION_STYLE)]
inner_p = []
for p in principles:
inner_p.append(Paragraph("• " + p, SMALL_J))
inner_p.append(Spacer(1, 3))
box = Table([[inner_p]], colWidths=[available_w])
box.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#F0F8F4")),
("BOX", (0,0), (-1,-1), 1, LIGHT_GREEN),
("ROUNDEDCORNERS", [6]),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 14),
("RIGHTPADDING", (0,0), (-1,-1), 14),
]))
banner_row = Table(
[[Paragraph("KEY PRESCRIBING PRINCIPLES", SECTION_STYLE)]],
colWidths=[available_w]
)
banner_row.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), MID_GREEN),
("ROUNDEDCORNERS", [4]),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
]))
story.append(KeepTogether([banner_row, Spacer(1,6), box]))
# Footer note
story.append(Spacer(1, 10))
story.append(hline(color=LIGHT_GREEN, thickness=0.8))
story.append(Paragraph(
"Reference: Charaka Samhita (Su. 4/6) | Sharangadhara Samhita (Madhyamakhanda 2) | "
"Ashtanga Hridayam | A Critical Review of Kwatha Kalpana, IJAM Vol 11(2) | "
"Panchavidha Kashaya Kalpana — Conceptual Review, Ayurpub 2018 • "
"This guide is for educational reference. Clinical application requires qualified Ayurvedic supervision.",
FOOTER_STYLE))
return story
# ─── Build PDF ────────────────────────────────────────────────────────────────
def add_page_numbers(canvas_obj, doc):
canvas_obj.saveState()
canvas_obj.setFont("Helvetica", 8)
canvas_obj.setFillColor(MID_GREY)
page_num = canvas_obj.getPageNumber()
canvas_obj.drawRightString(PAGE_W - MARGIN, 0.9*cm,
f"Page {page_num} • Panchavidha Kashaya Kalpana — Quick Reference")
canvas_obj.drawString(MARGIN, 0.9*cm, "For Practitioner Use")
canvas_obj.restoreState()
doc = make_doc()
story = build_story()
doc.build(story, onFirstPage=add_page_numbers, onLaterPages=add_page_numbers)
print("PDF generated:", OUTPUT)
cd /home/daytona/workspace/kashaya-kalpana && python3 generate_pdf.py 2>&1
ls -lh /home/daytona/workspace/kashaya-kalpana/Panchavidha_Kashaya_Kalpana_Quick…
Panchavidha Kashaya Kalpana Quick Reference
PDF Document · PDF