Skip to content

gh-132983: Add documentation for compression.zstd #133911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

emmatyping
Copy link
Member

@emmatyping emmatyping commented May 12, 2025

This PR adds docs for the compression and compression.zstd modules.


📚 Documentation preview 📚: https://cpython-previews--133911.org.readthedocs.build/

@emmatyping emmatyping added the needs backport to 3.14 bugs and security fixes label May 12, 2025
Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntactic review

@@ -5,13 +5,15 @@ Data Compression and Archiving
******************************

The modules described in this chapter support data compression with the zlib,
gzip, bzip2 and lzma algorithms, and the creation of ZIP- and tar-format
gzip, bzip2, zstd, and lzma algorithms, and the creation of ZIP- and tar-format
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New algorithm at the end?

Suggested change
gzip, bzip2, zstd, and lzma algorithms, and the creation of ZIP- and tar-format
gzip, bzip2, lzma, and zstd algorithms, and the creation of ZIP- and tar-format

Comment on lines +1 to +2
The :mod:`!compression` package
=================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The :mod:`!compression` package
=================================
The :mod:`!compression` package
===============================

Comment on lines +6 to +13
.. note::

Several modules in :mod:`!compression` re-export modules that currently
exist at the repository top-level. These re-exported modules are the new
canonical import name for the respective top-level module. The existing
modules are not currently deprecated and will not be removed prior to Python
3.19, but users are encouraged to migrate to the new import names when
feasible.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. note::
Several modules in :mod:`!compression` re-export modules that currently
exist at the repository top-level. These re-exported modules are the new
canonical import name for the respective top-level module. The existing
modules are not currently deprecated and will not be removed prior to Python
3.19, but users are encouraged to migrate to the new import names when
feasible.
.. attention::
The :mod:`!compression` package is the new location for the data compression
modules in the standard library, listed below. The existing modules are not
deprecated and will not be removed before Python 3.19. The new ``compression.*``
import names are encouraged for use where practicable.

Comment on lines +15 to +23
* :mod:`!compression.bz2` -- Re-exports :mod:`bz2`

* :mod:`!compression.gzip` -- Re-exports :mod:`gzip`

* :mod:`!compression.lzma` -- Re-exports :mod:`lzma`

* :mod:`!compression.zlib` -- Re-exports :mod:`zlib`

* :mod:`compression.zstd` -- Wrapper for the Zstandard compression library
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* :mod:`!compression.bz2` -- Re-exports :mod:`bz2`
* :mod:`!compression.gzip` -- Re-exports :mod:`gzip`
* :mod:`!compression.lzma` -- Re-exports :mod:`lzma`
* :mod:`!compression.zlib` -- Re-exports :mod:`zlib`
* :mod:`compression.zstd` -- Wrapper for the Zstandard compression library
* :mod:`!compression.bz2` -- Re-exports :mod:`bz2`
* :mod:`!compression.gzip` -- Re-exports :mod:`gzip`
* :mod:`!compression.lzma` -- Re-exports :mod:`lzma`
* :mod:`!compression.zlib` -- Re-exports :mod:`zlib`
* :mod:`compression.zstd` -- Wrapper for the Zstandard compression library


* :mod:`compression.zstd` -- Wrapper for the Zstandard compression library


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines +728 to +729
Creating a compressed file::

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Creating a compressed file::
Creating a compressed file:
.. code-block:: python

Comment on lines +735 to +736
Compressing data in memory::

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Compressing data in memory::
Compressing data in memory:
.. code-block:: python

Comment on lines +741 to +742
Incremental compression::

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Incremental compression::
Incremental compression:
.. code-block:: python

Comment on lines +752 to +753
Writing compressed data to an already-open file::

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Writing compressed data to an already-open file::
Writing compressed data to an already-open file:
.. code-block:: python

Comment on lines +761 to +762
Creating a compressed file using compression parameters::

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Creating a compressed file using compression parameters::
Creating a compressed file using compression parameters:
.. code-block:: python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir needs backport to 3.14 bugs and security fixes skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants