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

Merged
merged 23 commits into from
May 21, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
49d9c30
Add documentation for compression.zstd
emmatyping May 12, 2025
62ef4dc
Add examples
emmatyping May 12, 2025
0b154b1
Fix camelcase name references
emmatyping May 12, 2025
63f963f
CParameter->CompressionParameter
emmatyping May 12, 2025
cfe0590
Apply suggestions from AA-Turner
emmatyping May 12, 2025
5115b4c
Apply suggestions from reviewers
emmatyping May 12, 2025
4ab7fd7
Apply suggestions from reviewers
emmatyping May 12, 2025
5eb5efc
Apply suggestions from reviewers
emmatyping May 14, 2025
987bd27
Don't reference self when referring to items
emmatyping May 14, 2025
615ed7f
Updates to respond to review
emmatyping May 14, 2025
0f7bc05
Remove outdated paragraph
emmatyping May 15, 2025
44173f3
Remove Zstandard dictionary after ZstdDict
emmatyping May 16, 2025
8bd5500
Rewrite introduction to compression package to be more timeless
emmatyping May 18, 2025
24f3761
Remove content_size_flag
emmatyping May 18, 2025
d04ce4f
Merge branch 'zstd-docs' of github.com:emmatyping/cpython into zstd-docs
emmatyping May 18, 2025
e61e9a1
Apply suggestions from Sumana and Stan
emmatyping May 19, 2025
1149832
Remove ref to Meta and clean up mode usage
emmatyping May 20, 2025
71ed7c3
Apply suggestions from vadmium
emmatyping May 20, 2025
2f895dd
Many updates to respond to review
emmatyping May 20, 2025
f25e6e7
Add examples to (De)compressionParameter
emmatyping May 20, 2025
9ff6320
Add reference to zstd manual and blurb on algorithm
emmatyping May 20, 2025
daa9df1
Expand on the connection between level and compression_level
emmatyping May 21, 2025
b3fd3cd
Resolve review suggestions
emmatyping May 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Resolve review suggestions
- Use "integer" instead of "int object"
- Use > 0 rather than >=1 for nb_workers
  • Loading branch information
emmatyping committed May 21, 2025
commit b3fd3cd05202a68509ffa800247e989aadf42f85
20 changes: 10 additions & 10 deletions Doc/library/compression.zstd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Compressing and decompressing data in memory
Compress *data* (a :term:`bytes-like object`), returning the compressed
data as a :class:`bytes` object.

The *level* argument is an int object controlling the level of
The *level* argument is an integer controlling the level of
compression. *level* is an alternative to setting
:attr:`CompressionParameter.compression_level` in *options*. Use
:meth:`~CompressionParameter.bounds` on
Expand Down Expand Up @@ -202,7 +202,7 @@ Compressing and decompressing data in memory
For a more convenient way of compressing a single chunk of data, see the
module-level function :func:`compress`.

The *level* argument is an int object controlling the level of
The *level* argument is an integer controlling the level of
compression. *level* is an alternative to setting
:attr:`CompressionParameter.compression_level` in *options*. Use
:meth:`~CompressionParameter.bounds` on
Expand Down Expand Up @@ -575,7 +575,7 @@ Advanced parameter control
inputs by finding large matches at greater distances. It increases memory
usage and window size.

``True`` or ``0`` enable long distance matching while ``False`` or ``1``
``True`` or ``1`` enable long distance matching while ``False`` or ``0``
disable it.

Enabling this parameter increases default
Expand Down Expand Up @@ -622,23 +622,23 @@ Advanced parameter control
the checksum. If there is a mismatch a :class:`ZstdError` exception is
raised.

``True`` or ``0`` enable checksum generation while ``False`` or ``1``
``True`` or ``1`` enable checksum generation while ``False`` or ``0``
disable it.

.. attribute:: dict_id_flag

When compressing with a :class:`ZstdDict`, the dictionary's ID is written
into the frame header.

``True`` or ``0`` enable storing the dictionary ID while ``False`` or
``1`` disable it.
``True`` or ``1`` enable storing the dictionary ID while ``False`` or
``0`` disable it.

.. attribute:: nb_workers

Select how many threads will be spawned to compress in parallel. When
:attr:`!nb_workers` >= 1, enables multi-threaded compression, 1
means "one-thread multi-threaded mode". More workers improve speed, but
also increase memory usage and slightly reduce compression ratio.
:attr:`!nb_workers` > 0, enables multi-threaded compression, a value of
``1`` means "one-thread multi-threaded mode". More workers improve speed,
but also increase memory usage and slightly reduce compression ratio.

A value of zero disables multi-threading.

Expand Down Expand Up @@ -753,7 +753,7 @@ Miscellaneous

.. attribute:: dictionary_id

An int object representing the Zstandard dictionary ID needed for
An integer representing the Zstandard dictionary ID needed for
decompressing the frame. ``0`` means the dictionary ID was not
recorded in the frame header. This may mean that a Zstandard dictionary
is not needed, or that the ID of a required dictionary was not recorded.
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy