資料壓縮與保存
**************

本章中描述的模組支援使用 zlib、gzip、bzip2、lzma 和 zstd 演算法進行資
料壓縮，以及建立 ZIP 和 tar 格式的存檔。另請參閱 "shutil" 模組提供的
Archiving operations。

* "compression" 套件

* "compression.zstd" --- 與 Zstandard 格式相容的壓縮

  * 例外

  * Reading and writing compressed files

  * Compressing and decompressing data in memory

  * Zstandard 字典

  * Advanced parameter control

  * Miscellaneous

  * 範例

* "zlib" --- 相容於 **gzip** 的壓縮

* "gzip" --- **gzip** 檔案的支援

  * 用法範例

  * 命令列介面

    * 命令列選項

* "bz2" --- **bzip2** 壓縮的支援

  * (De)compression of files

  * Incremental (de)compression

  * One-shot (de)compression

  * 用法範例

* "lzma" --- 使用 LZMA 演算法進行壓縮

  * Reading and writing compressed files

  * Compressing and decompressing data in memory

  * Miscellaneous

  * Specifying custom filter chains

  * 範例

* "zipfile" --- 處理 ZIP 封存檔案

  * ZipFile 物件

  * Path 物件

  * PyZipFile 物件

  * ZipInfo 物件

  * 命令列介面

    * 命令列選項

  * 解壓縮的陷阱

    * 來自檔案本身

    * 檔案系統限制

    * 資源限制

    * 中斷

    * 解壓縮的預設行為

* "tarfile" --- 讀取與寫入 tar 封存檔案

  * TarFile 物件

  * TarInfo 物件

  * 解壓縮篩選器

    * 預設具名篩選器

    * 篩選器錯誤

    * 進一步驗證的提示

    * 支援舊版 Python

    * 有狀態的解壓縮篩選器範例

  * 命令列介面

    * 命令列選項

  * 範例

    * 讀取範例

    * 寫入範例

  * 支援的 tar 格式

  * Unicode 議題
