PyDocs

Nav

Data Compression and Archiving

finalize_dict

  • finalize_dict(zstd_dict, /, samples, dict_size, level)
Return a ZstdDict representing a finalized Zstandard dictionary.

Given a custom content as a basis for dictionary, and a set of samples,
finalize *zstd_dict* by adding headers and statistics according to the
Zstandard dictionary format.

You may compose an effective dictionary content by hand, which is used
as basis dictionary, and use some samples to finalize a dictionary.  The
basis dictionary may be a "raw content" dictionary.  See *is_raw* in
ZstdDict.

*samples* is an iterable of samples, where a sample is a bytes-like
object representing a file.
*dict_size* is the dictionary's maximum size, in bytes.
*level* is the expected compression level. The statistics for each
compression level differ, so tuning the dictionary to the compression
level can provide improvements.
0 Examples
No examples for compression.zstd/finalize_dict.
See Also
No see-alsos for compression.zstd/finalize_dict
0 Notes
No notes for finalize_dict