From 77d364652316ec395248cdf887d1a5cfe3994ce3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Jul 2026 13:25:03 +0000 Subject: [PATCH 1/2] Initial plan From 0c24d305a2a48acbfc2725c8d4d0dafd15e1f71c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Jul 2026 13:28:01 +0000 Subject: [PATCH 2/2] docs: add README.md to all chapter directories with Colab links - Add README.md to 01.Intro-Python with table of all ipynb files and Open in Colab badges - Add README.md to 02.Gradio with Colab link and quick start instructions - Add README.md to 03.Request with Colab links and learning highlights - Add README.md to 04.Playwright with Colab link and setup instructions - Add README.md to 04.Selenium with Colab links and WebDriver setup guide - Add README.md to 07.Pytest-DEMO with Colab link and pytest command examples - Add README.md to 09.Apps with Colab links for QRCode and OpenAI demos - Add README.md to 10.sql with Colab link and CRUD learning highlights - Add README.md to 11.AI with Colab links and Gemini API setup guide - Update root README.md with a chapter navigation table linking to all READMEs Closes #10 --- 01.Intro-Python/README.md | 46 ++++++++++++++++++++++++ 02.Gradio/README.md | 38 ++++++++++++++++++++ 03.Request/README.md | 42 ++++++++++++++++++++++ 04.Playwright/README.md | 62 ++++++++++++++++++++++++++++++++ 04.Selenium/README.md | 74 +++++++++++++++++++++++++++++++++++++++ 07.Pytest-DEMO/README.md | 61 ++++++++++++++++++++++++++++++++ 09.Apps/README.md | 66 ++++++++++++++++++++++++++++++++++ 10.sql/README.md | 41 ++++++++++++++++++++++ 11.AI/README.md | 60 +++++++++++++++++++++++++++++++ README.md | 17 +++++++++ 10 files changed, 507 insertions(+) create mode 100644 01.Intro-Python/README.md create mode 100644 02.Gradio/README.md create mode 100644 03.Request/README.md create mode 100644 04.Playwright/README.md create mode 100644 04.Selenium/README.md create mode 100644 07.Pytest-DEMO/README.md create mode 100644 09.Apps/README.md create mode 100644 10.sql/README.md create mode 100644 11.AI/README.md diff --git a/01.Intro-Python/README.md b/01.Intro-Python/README.md new file mode 100644 index 0000000..3989340 --- /dev/null +++ b/01.Intro-Python/README.md @@ -0,0 +1,46 @@ +# 01. Python 入門與資料分析 + +本章節涵蓋 Python 基礎語法、資料分析常用套件 (NumPy、Pandas),以及資料視覺化入門,適合初學者循序漸進學習。 + +## 📒 教材清單 + +| 教材 | 說明 | 開啟方式 | +|------|------|----------| +| [Intro_Python-101.ipynb](Intro_Python-101.ipynb) | Python 基礎入門 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/Intro_Python-101.ipynb) | +| [PythonBasic_2.ipynb](PythonBasic_2.ipynb) | Python 基礎語法 (二) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/PythonBasic_2.ipynb) | +| [PythonBasic_3.ipynb](PythonBasic_3.ipynb) | Python 基礎語法 (三) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/PythonBasic_3.ipynb) | +| [PythonBasic_4.ipynb](PythonBasic_4.ipynb) | Python 基礎語法 (四) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/PythonBasic_4.ipynb) | +| [NumPy_Tutorial.ipynb](NumPy_Tutorial.ipynb) | NumPy 數值運算教學 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/NumPy_Tutorial.ipynb) | +| [10分鐘Pandas.ipynb](10分鐘Pandas.ipynb) | 10 分鐘快速學會 Pandas | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/10分鐘Pandas.ipynb) | +| [Python資料分析入門_打底篇.ipynb](Python資料分析入門_打底篇.ipynb) | 資料分析入門 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/Python資料分析入門_打底篇.ipynb) | +| [Python資料分析應用_股票分析入門.ipynb](Python資料分析應用_股票分析入門.ipynb) | 股票資料分析入門 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/Python資料分析應用_股票分析入門.ipynb) | +| [來畫圖好嗎_資料視覺化.ipynb](來畫圖好嗎_資料視覺化.ipynb) | Matplotlib / Seaborn 資料視覺化 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/來畫圖好嗎_資料視覺化.ipynb) | +| [資料視覺化_Dash(人均GDP).ipynb](資料視覺化_Dash(人均GDP).ipynb) | Dash 互動式視覺化 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/資料視覺化_Dash(人均GDP).ipynb) | +| [資料前置處理.ipynb](資料前置處理.ipynb) | 資料清理與前置處理 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/資料前置處理.ipynb) | +| [EDA_Titanic_Survival_Analysis.ipynb](EDA_Titanic_Survival_Analysis.ipynb) | 鐵達尼號探索性資料分析 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/EDA_Titanic_Survival_Analysis.ipynb) | +| [監督學習應用教學.ipynb](監督學習應用教學.ipynb) | 機器學習監督式學習入門 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/監督學習應用教學.ipynb) | +| [Python_ChatGPT_Data_Analysis.ipynb](Python_ChatGPT_Data_Analysis.ipynb) | ChatGPT 輔助資料分析 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/Python_ChatGPT_Data_Analysis.ipynb) | +| [活用JupyterNotebook.ipynb](活用JupyterNotebook.ipynb) | Jupyter Notebook 使用技巧 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/活用JupyterNotebook.ipynb) | +| [亂數報告抽籤.ipynb](亂數報告抽籤.ipynb) | 亂數與隨機應用 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/亂數報告抽籤.ipynb) | +| [112BDA期中報告示範.ipynb](112BDA期中報告示範.ipynb) | 期中報告示範 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/01.Intro-Python/112BDA期中報告示範.ipynb) | + +## 🚀 啟動 Jupyter Notebook (本機) + +```bash +# 使用 uv (推薦) +uv run --with jupyter jupyter notebook + +# 或使用腳本 +# Windows +..\scripts\run-jupyter.ps1 -Path "01.Intro-Python" + +# macOS/Linux +../scripts/run-jupyter.sh "01.Intro-Python" +``` + +## 📚 學習建議 + +1. 建議從 `Intro_Python-101.ipynb` 開始,熟悉 Python 基本語法。 +2. 依序學習 `PythonBasic_2` → `3` → `4`,鞏固程式基礎。 +3. 再學習 NumPy 與 Pandas,掌握資料處理能力。 +4. 最後進入資料視覺化與分析實作,完成完整的資料分析流程。 diff --git a/02.Gradio/README.md b/02.Gradio/README.md new file mode 100644 index 0000000..f7202db --- /dev/null +++ b/02.Gradio/README.md @@ -0,0 +1,38 @@ +# 02. Gradio — 互動式 AI 介面 + +本章節介紹如何使用 [Gradio](https://www.gradio.app/) 快速建立機器學習模型的互動式網頁介面,無需前端開發經驗,適合在 Google Colab 環境中直接執行。 + +## 📒 教材清單 + +| 教材 | 說明 | 開啟方式 | +|------|------|----------| +| [gradio_demo.ipynb](gradio_demo.ipynb) | Gradio 互動介面入門示範 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/02.Gradio/gradio_demo.ipynb) | + +## 🚀 快速開始 + +### 在 Google Colab 執行 (推薦) + +直接點擊上方的 **Open in Colab** 徽章即可在 Colab 執行,無需本機環境設定。 + +### 本機執行 + +```bash +# 使用 uv (推薦) +uv run --with gradio --with jupyter jupyter notebook gradio_demo.ipynb + +# 或使用傳統方式 +pip install gradio +jupyter notebook gradio_demo.ipynb +``` + +## 📚 學習重點 + +- Gradio 基本元件 (Textbox、Image、Audio 等) +- 建立簡易 AI 互動介面 +- 在 Colab 分享 Gradio 公開連結 +- 結合機器學習模型進行示範 + +## 🔗 相關資源 + +- [Gradio 官方文件](https://www.gradio.app/docs/) +- [Gradio GitHub](https://github.com/gradio-app/gradio) diff --git a/03.Request/README.md b/03.Request/README.md new file mode 100644 index 0000000..1be111b --- /dev/null +++ b/03.Request/README.md @@ -0,0 +1,42 @@ +# 03. 網頁擷取與 API 資料存取 + +本章節介紹如何使用 Python `requests` 函式庫進行網頁內容擷取,以及如何透過 API 存取開放資料,適合初學者學習資料蒐集的基礎技巧。 + +## 📒 教材清單 + +| 教材 | 說明 | 開啟方式 | +|------|------|----------| +| [網頁擷取_Request.ipynb](網頁擷取_Request.ipynb) | 使用 Requests 進行基礎網頁擷取 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/03.Request/網頁擷取_Request.ipynb) | +| [擷取API資料.ipynb](擷取API資料.ipynb) | API 資料存取與解析 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/03.Request/擷取API資料.ipynb) | +| [RequestsOpenData_HW.ipynb](RequestsOpenData_HW.ipynb) | 開放資料實作練習 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/03.Request/RequestsOpenData_HW.ipynb) | + +## 🚀 快速開始 + +### 在 Google Colab 執行 (推薦) + +直接點擊上方的 **Open in Colab** 徽章即可在 Colab 執行,所需套件已預裝於 Colab 環境。 + +### 本機執行 + +```bash +# 使用 uv (推薦) +uv run --with requests --with beautifulsoup4 --with jupyter jupyter notebook + +# 或使用傳統方式 +pip install requests beautifulsoup4 +jupyter notebook +``` + +## 📚 學習重點 + +- HTTP 請求基礎 (GET / POST) +- 使用 `requests` 抓取網頁 HTML +- 使用 BeautifulSoup 解析 HTML 結構 +- 存取 JSON 格式的 REST API +- 解析政府開放資料 (data.gov.tw) + +## 🔗 相關資源 + +- [Requests 官方文件](https://docs.python-requests.org/) +- [BeautifulSoup 文件](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) +- [政府資料開放平臺](https://data.gov.tw/) diff --git a/04.Playwright/README.md b/04.Playwright/README.md new file mode 100644 index 0000000..554d521 --- /dev/null +++ b/04.Playwright/README.md @@ -0,0 +1,62 @@ +# 04. Playwright — 瀏覽器自動化爬蟲 + +本章節介紹如何使用 [Playwright](https://playwright.dev/python/) 進行瀏覽器自動化操作,適合處理需要執行 JavaScript 的動態網頁。Playwright 支援錄製腳本功能,可大幅降低撰寫爬蟲的門檻。 + +## 📒 教材清單 + +| 教材 | 說明 | 開啟方式 | +|------|------|----------| +| [damun.ipynb](damun.ipynb) | Playwright 實作示範 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/04.Playwright/damun.ipynb) | + +## 📁 檔案說明 + +| 檔案 | 說明 | +|------|------| +| `damun.ipynb` | Playwright 互動式教學筆記本 | +| `damun.py` | Playwright 爬蟲腳本 | +| `damun_33846.json` | 擷取資料範例 | +| `page.json` | 頁面結構範例 | +| `Playwright_proj/` | Playwright 專案範例 | + +## 🚀 快速開始 + +### 安裝 Playwright + +```bash +# 使用 uv (推薦) +uv run --with playwright python -m playwright install chromium + +# 或使用傳統方式 +pip install playwright +playwright install chromium +``` + +### 執行腳本 + +```bash +# 使用 uv 執行 +uv run --with playwright damun.py + +# 或直接執行 +python damun.py +``` + +### 錄製腳本 (Codegen) + +```bash +# 啟動錄製模式,操作瀏覽器後自動產生程式碼 +playwright codegen https://example.com +``` + +## 📚 學習重點 + +- Playwright 安裝與基本設定 +- 啟動瀏覽器並導航至網頁 +- 定位元素與擷取資料 +- 使用 Codegen 錄製操作腳本 +- 處理動態載入內容 + +## 🔗 相關資源 + +- [Playwright Python 官方文件](https://playwright.dev/python/) +- [Playwright GitHub](https://github.com/microsoft/playwright-python) diff --git a/04.Selenium/README.md b/04.Selenium/README.md new file mode 100644 index 0000000..2dc6935 --- /dev/null +++ b/04.Selenium/README.md @@ -0,0 +1,74 @@ +# 04. Selenium — 動態網頁爬蟲 + +本章節介紹如何使用 [Selenium](https://www.selenium.dev/) 進行動態網頁的自動化操作與資料擷取,適合需要模擬使用者行為(登入、捲動、點擊)的進階爬蟲需求。 + +## 📒 教材清單 + +| 教材 | 說明 | 開啟方式 | +|------|------|----------| +| [網頁擷取_Selenium.ipynb](網頁擷取_Selenium.ipynb) | Selenium 基礎網頁擷取教學 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/04.Selenium/網頁擷取_Selenium.ipynb) | +| [ptt_selenium.ipynb](ptt_selenium.ipynb) | PTT 看板資料爬蟲 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/04.Selenium/ptt_selenium.ipynb) | +| [yahoo_selenium.ipynb](yahoo_selenium.ipynb) | Yahoo 股市資料爬蟲 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/04.Selenium/yahoo_selenium.ipynb) | + +## 📁 檔案說明 + +| 檔案 | 說明 | +|------|------| +| `網頁擷取_Selenium.ipynb` | Selenium 互動式教學筆記本 | +| `ptt_selenium.py` | PTT 爬蟲 Python 腳本 | +| `yahoo_selenium.py` | Yahoo 股市爬蟲 Python 腳本 | +| `ptt_scraping_dag.py` | PTT 爬蟲 DAG 排程腳本 | + +## 🚀 快速開始 + +### 安裝套件 + +```bash +# 使用 uv (推薦) +uv run --with selenium --with webdriver-manager python ptt_selenium.py + +# 或使用傳統方式 +pip install selenium webdriver-manager +``` + +### 安裝瀏覽器驅動程式 + +Selenium 需要對應瀏覽器的 WebDriver: + +- **Chrome**: [ChromeDriver](https://chromedriver.chromium.org/) +- **Firefox**: [GeckoDriver](https://github.com/mozilla/geckodriver) + +使用 `webdriver-manager` 可自動下載對應版本的驅動程式: + +```python +from selenium import webdriver +from webdriver_manager.chrome import ChromeDriverManager + +driver = webdriver.Chrome(ChromeDriverManager().install()) +``` + +### 執行腳本 + +```bash +python ptt_selenium.py +python yahoo_selenium.py +``` + +## 📚 學習重點 + +- Selenium WebDriver 基本操作 +- 定位元素 (CSS Selector、XPath) +- 模擬點擊、輸入、捲動等使用者行為 +- 等待頁面載入 (Implicit / Explicit Wait) +- 處理動態 JavaScript 渲染內容 + +## ⚠️ 注意事項 + +- 請確認 ChromeDriver 版本與 Chrome 瀏覽器版本相符 +- 部分網站對爬蟲有防護機制,請遵守網站使用條款 +- 建議加入適當的等待時間,避免請求過於頻繁 + +## 🔗 相關資源 + +- [Selenium 官方文件](https://www.selenium.dev/documentation/) +- [webdriver-manager PyPI](https://pypi.org/project/webdriver-manager/) diff --git a/07.Pytest-DEMO/README.md b/07.Pytest-DEMO/README.md new file mode 100644 index 0000000..d5836b9 --- /dev/null +++ b/07.Pytest-DEMO/README.md @@ -0,0 +1,61 @@ +# 07. Pytest — 自動化測試入門 + +本章節介紹如何使用 [pytest](https://docs.pytest.org/) 為 Python 程式撰寫自動化測試,涵蓋單元測試、API 測試與測試覆蓋率報告。 + +## 📒 教材清單 + +| 教材 | 說明 | 開啟方式 | +|------|------|----------| +| [Pytest_Demo.ipynb](Pytest_Demo.ipynb) | pytest 入門示範 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/07.Pytest-DEMO/Pytest_Demo.ipynb) | + +## 📁 檔案說明 + +| 檔案 | 說明 | +|------|------| +| `Pytest_Demo.ipynb` | pytest 互動式教學筆記本 | +| `my_module.py` | 受測試的模組範例 | +| `test_my_module.py` | 對應的單元測試檔案 | +| `test_tasks_api.py` | Tasks API 測試 | +| `requirements.txt` | 相依套件清單 | + +## 🚀 快速開始 + +### 安裝套件 + +```bash +# 使用 uv (推薦) +uv pip install -r requirements.txt + +# 或使用傳統方式 +pip install -r requirements.txt +``` + +### 執行測試 + +```bash +# 執行全部測試 +pytest + +# 執行並顯示詳細資訊 +pytest -v + +# 執行並產生測試覆蓋率報告 +pytest --cov=./ + +# 產生 HTML 格式的覆蓋率報告 +pytest --cov-report=html +``` + +## 📚 學習重點 + +- pytest 基本測試寫法 +- 測試函式命名慣例 (`test_` 前綴) +- Fixture 的使用 +- 參數化測試 (`@pytest.mark.parametrize`) +- API 端點測試 +- 測試覆蓋率 (Coverage) 分析 + +## 🔗 相關資源 + +- [pytest 官方文件](https://docs.pytest.org/) +- [pytest-cov 插件](https://pytest-cov.readthedocs.io/) diff --git a/09.Apps/README.md b/09.Apps/README.md new file mode 100644 index 0000000..5995fd0 --- /dev/null +++ b/09.Apps/README.md @@ -0,0 +1,66 @@ +# 09. 實用應用程式 + +本章節收錄各種 Python 實用應用範例,包含 QR Code 產生器、OpenAI 應用示範等,可直接在 Google Colab 上執行。 + +## 📒 教材清單 + +| 教材 | 說明 | 開啟方式 | +|------|------|----------| +| [QRCode.ipynb](QRCode.ipynb) | QR Code 產生器 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/09.Apps/QRCode.ipynb) | +| [OpenAI_Demo.ipynb](OpenAI_Demo.ipynb) | OpenAI API 應用示範 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/09.Apps/OpenAI_Demo.ipynb) | + +## 📁 檔案說明 + +| 檔案 | 說明 | +|------|------| +| `QRCode.ipynb` | QR Code 產生器,支援純黑白、彩色背景與 GIF 動態背景 | +| `QRCode.md` | QR Code 應用說明文件 | +| `OpenAI_Demo.ipynb` | OpenAI API 串接示範 | + +## 🚀 快速開始 + +### 在 Google Colab 執行 (推薦) + +直接點擊上方的 **Open in Colab** 徽章即可在 Colab 執行。 + +### QR Code 本機執行 + +```bash +# 使用 uv (推薦) +uv run --with qrcode --with pillow --with jupyter jupyter notebook QRCode.ipynb + +# 或使用傳統方式 +pip install qrcode pillow +jupyter notebook QRCode.ipynb +``` + +### OpenAI Demo 本機執行 + +> ⚠️ 需要自備 OpenAI API Key + +```bash +# 使用 uv (推薦) +uv run --with openai --with jupyter jupyter notebook OpenAI_Demo.ipynb + +# 或使用傳統方式 +pip install openai +jupyter notebook OpenAI_Demo.ipynb +``` + +## 📚 學習重點 + +### QR Code +- 產生純黑白 QR Code +- 加入背景圖片製作彩色 QR Code +- 使用 GIF 動態背景 + +### OpenAI API +- OpenAI API 基本串接 +- 文字生成應用 +- 對話式 AI 範例 + +## 🔗 相關資源 + +- [qrcode PyPI](https://pypi.org/project/qrcode/) +- [OpenAI API 文件](https://platform.openai.com/docs/) +- [Pillow 文件](https://pillow.readthedocs.io/) diff --git a/10.sql/README.md b/10.sql/README.md new file mode 100644 index 0000000..d927906 --- /dev/null +++ b/10.sql/README.md @@ -0,0 +1,41 @@ +# 10. SQLite 資料庫 + +本章節介紹如何使用 Python 操作 SQLite 資料庫,涵蓋資料庫建立、查詢、更新、刪除等基本 CRUD 操作,適合初學者學習資料庫概念與 SQL 語法。 + +## 📒 教材清單 + +| 教材 | 說明 | 開啟方式 | +|------|------|----------| +| [SQLite資料庫CRUD.ipynb](SQLite資料庫CRUD.ipynb) | SQLite 資料庫 CRUD 完整教學 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/10.sql/SQLite資料庫CRUD.ipynb) | + +## 🚀 快速開始 + +### 在 Google Colab 執行 (推薦) + +直接點擊上方的 **Open in Colab** 徽章即可在 Colab 執行,SQLite 為 Python 內建模組,無需額外安裝套件。 + +### 本機執行 + +```bash +# SQLite 為 Python 內建,直接啟動 Jupyter 即可 +uv run --with jupyter jupyter notebook SQLite資料庫CRUD.ipynb + +# 或使用傳統方式 +jupyter notebook SQLite資料庫CRUD.ipynb +``` + +## 📚 學習重點 + +- SQLite 資料庫建立與連線 +- **C**reate:建立資料表與新增資料 (`INSERT`) +- **R**ead:查詢資料 (`SELECT`) +- **U**pdate:更新資料 (`UPDATE`) +- **D**elete:刪除資料 (`DELETE`) +- 使用 Python `sqlite3` 內建模組 +- 搭配 Pandas DataFrame 進行資料處理 + +## 🔗 相關資源 + +- [Python sqlite3 官方文件](https://docs.python.org/3/library/sqlite3.html) +- [SQLite 官方網站](https://www.sqlite.org/) +- [SQL 語法教學 (W3Schools)](https://www.w3schools.com/sql/) diff --git a/11.AI/README.md b/11.AI/README.md new file mode 100644 index 0000000..aeab349 --- /dev/null +++ b/11.AI/README.md @@ -0,0 +1,60 @@ +# 11. AI 與大型語言模型 (LLM) + +本章節介紹如何透過 Python 串接 AI 與大型語言模型 (LLM) API,以 Google Gemini 為主要示範,適合想要快速上手生成式 AI 應用的學習者。 + +## 📒 教材清單 + +| 教材 | 說明 | 開啟方式 | +|------|------|----------| +| [動手串接_LLM_API_入門教學(Gemini_).ipynb](動手串接_LLM_API_入門教學(Gemini_).ipynb) | Gemini API 入門教學 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/11.AI/動手串接_LLM_API_入門教學(Gemini_).ipynb) | +| [在_Colab_終端機使用_Gemini_CLI.ipynb](在_Colab_終端機使用_Gemini_CLI.ipynb) | 在 Colab 使用 Gemini CLI | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/11.AI/在_Colab_終端機使用_Gemini_CLI.ipynb) | +| [gemini_cli_colab_tutorial.ipynb](gemini_cli_colab_tutorial.ipynb) | Gemini CLI 完整教學 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/willismax/MediaSystem-Python-Course/blob/main/11.AI/gemini_cli_colab_tutorial.ipynb) | + +## 🚀 快速開始 + +### 在 Google Colab 執行 (推薦) + +直接點擊上方的 **Open in Colab** 徽章即可在 Colab 執行。 + +> ⚠️ 需要自備 Google AI Studio API Key,可前往 [Google AI Studio](https://aistudio.google.com/) 免費申請。 + +### 本機執行 + +```bash +# 使用 uv (推薦) +uv run --with google-generativeai --with jupyter jupyter notebook + +# 或使用傳統方式 +pip install google-generativeai +jupyter notebook +``` + +### 設定 API Key + +```python +import google.generativeai as genai + +genai.configure(api_key="YOUR_API_KEY") +``` + +在 Colab 中建議使用 Secrets 功能儲存 API Key: + +```python +from google.colab import userdata +api_key = userdata.get('GOOGLE_API_KEY') +``` + +## 📚 學習重點 + +- Google Gemini API 申請與設定 +- 基本文字生成 (Text Generation) +- 多輪對話 (Multi-turn Chat) +- 使用 Gemini CLI 於終端機互動 +- 結合 Python 建立 AI 應用 + +## 🔗 相關資源 + +- [Google AI Studio](https://aistudio.google.com/) +- [Gemini API 官方文件](https://ai.google.dev/docs) +- [google-generativeai PyPI](https://pypi.org/project/google-generativeai/) +- [Gemini CLI GitHub](https://github.com/google-gemini/gemini-cli) diff --git a/README.md b/README.md index cc4fb8d..f926853 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,23 @@ - [環境設定](#-快速開始-推薦使用-uv) - [專案說明](#相關專案摘要說明) +## 📂 章節導覽 + +| 章節 | 主題 | 說明 | +|------|------|------| +| [01.Intro-Python](01.Intro-Python/README.md) | Python 入門與資料分析 | Python 基礎語法、NumPy、Pandas、資料視覺化 | +| [02.Gradio](02.Gradio/README.md) | 互動式 AI 介面 | 使用 Gradio 快速建立 AI 示範介面 | +| [03.Request](03.Request/README.md) | 網頁擷取與 API 存取 | Requests、BeautifulSoup、開放資料 API | +| [04.Playwright](04.Playwright/README.md) | 瀏覽器自動化爬蟲 | Playwright 動態網頁爬蟲、腳本錄製 | +| [04.Selenium](04.Selenium/README.md) | 動態網頁爬蟲 | Selenium WebDriver 進階爬蟲 | +| [05.Flask](05.Flask/README.md) | Flask 網站開發 | 從基本網站到 RESTful API | +| [06.Line-bot-fly-flask](06.Line-bot-fly-flask/README.md) | LINE Bot 部署 | 在 Fly.io 部署 LINE Bot | +| [07.Pytest-DEMO](07.Pytest-DEMO/README.md) | 自動化測試 | pytest 單元測試與覆蓋率報告 | +| [08.OpenCV-Mediapipe-DEMO](08.OpenCV-Mediapipe-DEMO/readme.md) | 電腦視覺 | OpenCV + MediaPipe 肢體辨識 | +| [09.Apps](09.Apps/README.md) | 實用應用程式 | QR Code 產生器、OpenAI 應用 | +| [10.sql](10.sql/README.md) | SQLite 資料庫 | Python 資料庫 CRUD 操作 | +| [11.AI](11.AI/README.md) | AI 與大型語言模型 | Gemini API 串接與 LLM 應用 | + ## 範例程式碼下載 - 安裝[Git Cli](https://git-scm.com/) - 在終端機`git clone`專案