總結

開發 Python 套件

James Fulton

Climate informatics researcher

從小開始

  • NumPy——由 Travis Oliphant 發起
  • pandas——由 Wes McKinney 發起
開發 Python 套件

重點回顧

  • 模組 vs 子套件 vs 套件
  • 套件結構與 __init__.py
  • 絕對與相對匯入
  • 用 pyment 撰寫文件
  • 用 flake8 檢查程式風格
  • 用 setup.py 讓套件可安裝
  • 以 install_requires 與 requirements.txt 管理相依
  • 支援檔如 LICENSE、README.md、CONTRIBUTING.md、HISTORY.md
  • 用 twine 建置並上傳發行版到 PyPI
  • 用 pytest 與 tox 測試
  • 用 cookiecutter 套件樣板
  • 用 Makefile 高效維護套件
開發 Python 套件

延伸主題

套件網站

ReadtheDocs 與 Sphinx

開發 Python 套件

做得好!

開發 Python 套件

Preparing Video For Download...