加入授權與撰寫 README

開發 Python 套件

James Fulton

Climate informatics researcher

為什麼需要授權條款?

  • 授權他人使用你的程式碼
開發 Python 套件

開放原始碼授權

  • 更多資訊見 這裡
  • 允許使用者
    • 使用你的套件
    • 修改你的套件
    • 發佈你的套件版本
1 https://choosealicense.com
開發 Python 套件

什麼是 README?

  • 套件的「首頁」
  • 顯示於 Github 或 PyPI
開發 Python 套件

README 該包含什麼

README 章節

  • 標題
  • 簡介與功能
  • 安裝
  • 使用範例
  • 貢獻方式
  • 授權
開發 Python 套件

README 格式

Markdown (commonmark)

  • 放在 README.md 檔案中
  • 較簡單
  • 本課程與常見專案皆使用
reStructuredText

  • 放在 README.rst 檔案中
  • 較複雜
  • 在實務上也很常見
開發 Python 套件

Commonmark

README.md 的內容














`

轉譯後的呈現樣貌

開發 Python 套件

Commonmark

README.md 的內容

# mysklearn

mysklearn is a package for complete **linear regression** in Python.
You can find out more about this package on [DataCamp](https://datacamp.com)

轉譯後的呈現樣貌

mysklearn

mysklearn is a package for complete linear regression in python.

You can find out more about this package on DataCamp

開發 Python 套件

Commonmark

README.md 的內容

# mysklearn

mysklearn is a package for complete **linear regression** in Python.
You can find out more about this package on [DataCamp](https://datacamp.com)
## Installation You can install this package using

轉譯後的呈現樣貌

mysklearn

mysklearn is a package for complete linear regression in python.

You can find out more about this package on DataCamp

Installation

You can install this package using

開發 Python 套件

Commonmark

README.md 的內容

# mysklearn
mysklearn is a package for complete 
**linear regression** in Python.

You can find out more about this package 
on [DataCamp](https://datacamp.com)

## Installation
You can install this package using

```
pip install mysklearn
```

轉譯後的呈現樣貌

mysklearn

mysklearn is a package for complete linear regression in python.

You can find out more about this package on DataCamp

Installation

You can install this package using

pip install mysklearn
開發 Python 套件

把這些檔案加入你的套件

含子套件的套件目錄樹

mysklearn/
|-- mysklearn
|   |-- __init__.py
|   |-- preprocessing
|   |   |-- ...
|   |-- regression
|   |   |-- ...
|   |-- utils.py
|-- setup.py
|-- requirements.txt
|-- LICENSE      <--- 新增檔案
|-- README.md    <--- 加到頂層目錄
開發 Python 套件

MANIFEST.in

列出要包含在套件發佈中的額外檔案。

開發 Python 套件

MANIFEST.in

MANIFEST.in 的內容

include LICENSE
include README.md
mysklearn/
|-- mysklearn
|   |-- __init__.py
|   |-- preprocessing
|   |   |-- ...
|   |-- regression
|   |   |-- ...
|   |-- utils.py
|-- setup.py
|-- requirements.txt
|-- LICENSE
|-- README.md
|-- MANIFEST.in   <---
開發 Python 套件

一起來練習吧!

開發 Python 套件

Preparing Video For Download...