{
 "安裝 Python 與建立 venv 虛擬環境#1": {
  "type": "table",
  "head": [
   "Ubuntu",
   "預設 Python 3"
  ],
  "rows": [
   [
    "22.04",
    "3.10"
   ],
   [
    "24.04",
    "3.12"
   ]
  ],
  "reveal": [
   0,
   2,
   2
  ]
 },
 "安裝 Python 與建立 venv 虛擬環境#2": {
  "type": "table",
  "head": [
   "指令",
   "用途"
  ],
  "rows": [
   [
    "python3 --version",
    "查看版本"
   ],
   [
    "sudo apt update",
    "更新套件清單"
   ],
   [
    "sudo apt install -y python3 python3-venv python3-pip",
    "安裝 Python、venv、pip"
   ]
  ],
  "widths": [
   0.55,
   0.45
  ],
  "reveal": [
   0,
   1,
   3
  ]
 },
 "安裝 Python 與建立 venv 虛擬環境#4": {
  "type": "flow",
  "nodes": [
   {
    "label": "建立 venv",
    "sub": ".venv",
    "color": 0
   },
   {
    "label": "啟用",
    "sub": "source activate",
    "color": 1
   },
   {
    "label": "確認路徑",
    "sub": "which python",
    "color": 2
   },
   {
    "label": "離開",
    "sub": "deactivate",
    "kind": "end",
    "color": 3
   }
  ],
  "layout": "row",
  "reveal": [
   0,
   3,
   4
  ]
 },
 "安裝 Python 與建立 venv 虛擬環境#5": {
  "type": "cards",
  "cards": [
   {
    "title": ".venv 不進 git",
    "points": [
     "第一章忽略清單已排除"
    ]
   },
   {
    "title": "重現環境",
    "points": [
     "重建 venv",
     "照套件清單安裝"
    ]
   },
   {
    "title": "systemd / cron",
    "points": [
     "指定 venv 內 Python 完整路徑",
     "不會幫你啟用"
    ]
   }
  ],
  "reveal": [
   0,
   1,
   2,
   3
  ]
 },
 "pip 與 requirements.txt 套件管理#1": {
  "type": "table",
  "head": [
   "套件",
   "用途"
  ],
  "rows": [
   [
    "openai",
    "呼叫 LLM API(第三章)"
   ],
   [
    "python-dotenv",
    "從 .env 載入環境變數"
   ],
   [
    "psutil",
    "讀 CPU、記憶體、磁碟(第六章)"
   ],
   [
    "pydantic",
    "驗證結構化輸出與參數"
   ],
   [
    "pytest",
    "寫測試"
   ]
  ],
  "widths": [
   0.3,
   0.7
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ]
 },
 "pip 與 requirements.txt 套件管理#2": {
  "type": "flow",
  "nodes": [
   {
    "label": "pip freeze",
    "sub": "輸出版本",
    "color": 0
   },
   {
    "label": "requirements",
    "sub": "文字檔",
    "color": 1
   },
   {
    "label": "pip install -r",
    "sub": "還原環境",
    "kind": "end",
    "color": 2
   }
  ],
  "layout": "row",
  "reveal": [
   0,
   3,
   3
  ]
 },
 "pip 與 requirements.txt 套件管理#3": {
  "type": "table",
  "head": [
   "指令",
   "用途"
  ],
  "rows": [
   [
    "pip install --upgrade 套件",
    "升級單一套件"
   ],
   [
    "pip check",
    "檢查相依性衝突"
   ]
  ],
  "widths": [
   0.55,
   0.45
  ],
  "reveal": [
   0,
   0,
   1,
   2
  ]
 },
 "pip 與 requirements.txt 套件管理#4": {
  "type": "cards",
  "cards": [
   {
    "title": "確認拼字",
    "points": [
     "避免裝到名稱相似的惡意套件"
    ]
   },
   {
    "title": "只用官方 PyPI",
    "points": [
     "不執行來路不明的腳本"
    ]
   },
   {
    "title": "來源網址",
    "points": [
     "不放帳號密碼"
    ]
   }
  ],
  "reveal": [
   0,
   1,
   2,
   3
  ]
 },
 "pip 與 requirements.txt 套件管理#5": {
  "type": "flow",
  "nodes": [
   {
    "label": "有網路機器",
    "sub": "pip download",
    "color": 0
   },
   {
    "label": "wheels 目錄",
    "sub": "下載的套件",
    "color": 1
   },
   {
    "label": "搬到目標主機",
    "sub": "",
    "color": 2
   },
   {
    "label": "離線安裝",
    "sub": "指定從目錄安裝",
    "kind": "end",
    "color": 3
   }
  ],
  "layout": "row",
  "reveal": [
   0,
   4
  ]
 },
 "助理常用的 Python 語法與標準函式庫#3": {
  "type": "table",
  "head": [
   "欄位",
   "型別",
   "說明"
  ],
  "rows": [
   [
    "mount",
    "str",
    "掛載點"
   ],
   [
    "total_gb",
    "float",
    "總容量(GB)"
   ],
   [
    "used_percent",
    "float",
    "已使用百分比"
   ]
  ],
  "widths": [
   0.3,
   0.2,
   0.5
  ],
  "reveal": [
   0,
   1,
   2,
   3
  ]
 },
 "助理常用的 Python 語法與標準函式庫#4": {
  "type": "flow",
  "nodes": [
   {
    "label": "建立路徑",
    "sub": "Path 物件",
    "color": 0
   },
   {
    "label": "resolve",
    "sub": "完整解析",
    "color": 1
   },
   {
    "label": "比對目錄",
    "sub": "是否在允許目錄下",
    "color": 2
   },
   {
    "label": "False",
    "sub": "拒絕讀取",
    "kind": "end",
    "color": 3
   }
  ],
  "layout": "row",
  "reveal": [
   0,
   4,
   4,
   4
  ]
 },
 "安全執行系統指令:subprocess 白名單#2": {
  "type": "flow",
  "nodes": [
   {
    "label": "服務名稱",
    "sub": "使用者或模型給的",
    "color": 0
   },
   {
    "label": "拼進指令",
    "sub": "字串串接",
    "color": 1
   },
   {
    "label": "交給 shell",
    "sub": "或 shell=True",
    "color": 2
   },
   {
    "label": "分號後也執行",
    "sub": "指令注入",
    "kind": "end",
    "color": 3
   }
  ],
  "layout": "row",
  "reveal": [
   0,
   4,
   4
  ]
 },
 "安全執行系統指令:subprocess 白名單#3": {
  "type": "cards",
  "cards": [
   {
    "title": "參數串列",
    "points": [
     "不經過 shell"
    ]
   },
   {
    "title": "白名單",
    "points": [
     "不在名單就拒絕"
    ]
   },
   {
    "title": "timeout",
    "points": [
     "避免指令卡住"
    ]
   },
   {
    "title": "check=False",
    "points": [
     "自己判斷回傳碼"
    ]
   },
   {
    "title": "只回傳整理過的欄位",
    "points": [
     "不傳原始錯誤輸出"
    ]
   }
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ]
 }
}