仿照 httpx 架構的合成 Python 函式庫:exceptions → models → auth/transport → client 的乾淨分層。這是我們從頭到尾自己跑完的案例——6 個檔案全是程式碼,所以 graphify extract 全程本機、不需要任何 API key。
# 本站完整重現(純程式碼,零 API key)
graphify extract ./raw # 193 節點 · 456 邊 · 6 社群
graphify cluster-only ./raw # 生成報告與互動圖
小語料圖的結構價值:一眼看清分層與依賴。
| 指標 | 本站結果 |
|---|---|
| 節點數 | 193 |
| 邊數 | 456 |
| 社群數 | 6 |
| EXTRACTED 邊 | 76% |
| INFERRED 邊 | 24% |
INFERRED 110 條邊,平均信賴 0.5。0 token 成本。
Response — 55 條邊Request — 43 條邊Client — 27 條邊AsyncClient — 26 條邊BaseTransport — 20 條邊HTTPTransport — 20 條邊BaseClient — 19 條邊Cookies — 19 條邊AsyncHTTPTransport — 18 條邊TransportError — 16 條邊核心抽象完全正確:Request / Response 是 HTTP 訊息的兩端(度數最高),Client / AsyncClient / BaseClient 是同步/非同步 API 面,BaseTransport / HTTPTransport 是傳輸層。
Auth --uses--> Response — 認證處理器用到了 Response(解析 WWW-Authenticate 標頭)。Client / AsyncClient / BaseClient --uses--> Auth — 三個 client 都依賴認證抽象。這些 INFERRED 邊顯示「client 依賴 auth、auth 依賴 response」的隱含耦合——檔案層次看不出來,圖上一目了然。
# 語料在 upstream worked/httpx/raw,6 個 .py 檔。
# 本站產出:worked/httpx/graph.html · GRAPH_REPORT.md
graphify benchmark worked/httpx/graph.json # 驗證 token 節省