# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001 Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # python-doc bot, 2026 # Jyst Breisgau, 2026 # Swen Bachmann, 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-09-28 03:11+0000\n" "PO-Revision-Date: 2026-05-08 17:17+0000\n" "Last-Translator: Swen Bachmann, 2026\n" "Language-Team: German (https://app.transifex.com/python-doc/teams/5390/de/)\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../../library/compression.zstd.rst:2 msgid "" ":mod:`!compression.zstd` --- Compression compatible with the Zstandard format" msgstr "" #: ../../library/compression.zstd.rst:10 msgid "**Source code:** :source:`Lib/compression/zstd/__init__.py`" msgstr "" #: ../../library/compression.zstd.rst:14 msgid "" "This module provides classes and functions for compressing and decompressing " "data using the Zstandard (or *zstd*) compression algorithm. The `zstd manual " "`__ describes " "Zstandard as \"a fast lossless compression algorithm, targeting real-time " "compression scenarios at zlib-level and better compression ratios.\" Also " "included is a file interface that supports reading and writing the contents " "of ``.zst`` files created by the :program:`zstd` utility, as well as raw " "zstd compressed streams." msgstr "" #: ../../library/compression.zstd.rst:23 msgid "The :mod:`!compression.zstd` module contains:" msgstr "" #: ../../library/compression.zstd.rst:25 msgid "" "The :func:`.open` function and :class:`ZstdFile` class for reading and " "writing compressed files." msgstr "" #: ../../library/compression.zstd.rst:27 msgid "" "The :class:`ZstdCompressor` and :class:`ZstdDecompressor` classes for " "incremental (de)compression." msgstr "" #: ../../library/compression.zstd.rst:29 msgid "" "The :func:`compress` and :func:`decompress` functions for one-shot " "(de)compression." msgstr "" #: ../../library/compression.zstd.rst:31 msgid "" "The :func:`train_dict` and :func:`finalize_dict` functions and the :class:" "`ZstdDict` class to train and manage Zstandard dictionaries." msgstr "" #: ../../library/compression.zstd.rst:33 msgid "" "The :class:`CompressionParameter`, :class:`DecompressionParameter`, and :" "class:`Strategy` classes for setting advanced (de)compression parameters." msgstr "" #: ../../includes/optional-module.rst:1 msgid "" "This is an :term:`optional module`. If it is missing from your copy of " "CPython, look for documentation from your distributor (that is, whoever " "provided Python to you). If you are the distributor, see :ref:`optional-" "module-requirements`." msgstr "" "Dies ist ein :term:`optionales Modul `. Falls es in deiner " "Kopie von CPython fehlt, suche in der Dokumentation deines Distributors " "(also demjenigen, der dir Python zur Verfügung gestellt hat). Falls du " "selbst der Distributor bist, siehe :ref:`optional-module-requirements`." #: ../../library/compression.zstd.rst:40 msgid "Exceptions" msgstr "Ausnahmen" #: ../../library/compression.zstd.rst:44 msgid "" "This exception is raised when an error occurs during compression or " "decompression, or while initializing the (de)compressor state." msgstr "" #: ../../library/compression.zstd.rst:49 msgid "Reading and writing compressed files" msgstr "" #: ../../library/compression.zstd.rst:54 msgid "" "Open a Zstandard-compressed file in binary or text mode, returning a :term:" "`file object`." msgstr "" #: ../../library/compression.zstd.rst:57 msgid "" "The *file* argument can be either a file name (given as a :class:`str`, :" "class:`bytes` or :term:`path-like ` object), in which case " "the named file is opened, or it can be an existing file object to read from " "or write to." msgstr "" #: ../../library/compression.zstd.rst:62 msgid "" "The mode argument can be either ``'rb'`` for reading (default), ``'wb'`` for " "overwriting, ``'ab'`` for appending, or ``'xb'`` for exclusive creation. " "These can equivalently be given as ``'r'``, ``'w'``, ``'a'``, and ``'x'`` " "respectively. You may also open in text mode with ``'rt'``, ``'wt'``, " "``'at'``, and ``'xt'`` respectively." msgstr "" #: ../../library/compression.zstd.rst:68 ../../library/compression.zstd.rst:112 msgid "" "When reading, the *options* argument can be a dictionary providing advanced " "decompression parameters; see :class:`DecompressionParameter` for detailed " "information about supported parameters. The *zstd_dict* argument is a :class:" "`ZstdDict` instance to be used during decompression. When reading, if the " "*level* argument is not None, a :exc:`!TypeError` will be raised." msgstr "" #: ../../library/compression.zstd.rst:75 msgid "" "When writing, the *options* argument can be a dictionary providing advanced " "compression parameters; see :class:`CompressionParameter` for detailed " "information about supported parameters. The *level* argument is the " "compression level to use when writing compressed data. Only one of *level* " "or *options* may be non-None. The *zstd_dict* argument is a :class:" "`ZstdDict` instance to be used during compression." msgstr "" #: ../../library/compression.zstd.rst:83 msgid "" "In binary mode, this function is equivalent to the :class:`ZstdFile` " "constructor: ``ZstdFile(file, mode, ...)``. In this case, the *encoding*, " "*errors*, and *newline* parameters must not be provided." msgstr "" #: ../../library/compression.zstd.rst:87 msgid "" "In text mode, a :class:`ZstdFile` object is created, and wrapped in an :" "class:`io.TextIOWrapper` instance with the specified encoding, error " "handling behavior, and line endings." msgstr "" #: ../../library/compression.zstd.rst:95 msgid "Open a Zstandard-compressed file in binary mode." msgstr "" #: ../../library/compression.zstd.rst:97 msgid "" "A :class:`ZstdFile` can wrap an already-open :term:`file object`, or operate " "directly on a named file. The *file* argument specifies either the file " "object to wrap, or the name of the file to open (as a :class:`str`, :class:" "`bytes` or :term:`path-like ` object). If wrapping an " "existing file object, the wrapped file will not be closed when the :class:" "`ZstdFile` is closed." msgstr "" #: ../../library/compression.zstd.rst:104 msgid "" "The *mode* argument can be either ``'rb'`` for reading (default), ``'wb'`` " "for overwriting, ``'xb'`` for exclusive creation, or ``'ab'`` for appending. " "These can equivalently be given as ``'r'``, ``'w'``, ``'x'`` and ``'a'`` " "respectively." msgstr "" #: ../../library/compression.zstd.rst:109 msgid "" "If *file* is a file object (rather than an actual file name), a mode of " "``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." msgstr "" #: ../../library/compression.zstd.rst:119 msgid "" "When writing, the *options* argument can be a dictionary providing advanced " "compression parameters; see :class:`CompressionParameter` for detailed " "information about supported parameters. The *level* argument is the " "compression level to use when writing compressed data. Only one of *level* " "or *options* may be passed. The *zstd_dict* argument is a :class:`ZstdDict` " "instance to be used during compression." msgstr "" #: ../../library/compression.zstd.rst:127 msgid "" ":class:`!ZstdFile` supports all the members specified by :class:`io." "BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." "IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." msgstr "" #: ../../library/compression.zstd.rst:132 msgid "The following method and attributes are also provided:" msgstr "" #: ../../library/compression.zstd.rst:136 msgid "" "Return buffered data without advancing the file position. At least one byte " "of data will be returned, unless EOF has been reached. The exact number of " "bytes returned is unspecified (the *size* argument is ignored)." msgstr "" #: ../../library/compression.zstd.rst:140 msgid "" "While calling :meth:`peek` does not change the file position of the :class:" "`ZstdFile`, it may change the position of the underlying file object (for " "example, if the :class:`ZstdFile` was constructed by passing a file object " "for *file*)." msgstr "" #: ../../library/compression.zstd.rst:147 msgid "``'rb'`` for reading and ``'wb'`` for writing." msgstr "" #: ../../library/compression.zstd.rst:151 msgid "" "The name of the Zstandard file. Equivalent to the :attr:`~io.FileIO.name` " "attribute of the underlying :term:`file object`." msgstr "" #: ../../library/compression.zstd.rst:156 msgid "Compressing and decompressing data in memory" msgstr "" #: ../../library/compression.zstd.rst:160 msgid "" "Compress *data* (a :term:`bytes-like object`), returning the compressed data " "as a :class:`bytes` object." msgstr "" #: ../../library/compression.zstd.rst:163 #: ../../library/compression.zstd.rst:207 msgid "" "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 :attr:`~CompressionParameter.compression_level` to get the values that " "can be passed for *level*. If advanced compression options are needed, the " "*level* argument must be omitted and in the *options* dictionary the :attr:`!" "CompressionParameter.compression_level` parameter should be set." msgstr "" #: ../../library/compression.zstd.rst:172 #: ../../library/compression.zstd.rst:216 msgid "" "The *options* argument is a Python dictionary containing advanced " "compression parameters. The valid keys and values for compression parameters " "are documented as part of the :class:`CompressionParameter` documentation." msgstr "" #: ../../library/compression.zstd.rst:176 msgid "" "The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " "trained data to improve compression efficiency. The function :func:" "`train_dict` can be used to generate a Zstandard dictionary." msgstr "" #: ../../library/compression.zstd.rst:183 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning the uncompressed " "data as a :class:`bytes` object." msgstr "" #: ../../library/compression.zstd.rst:186 #: ../../library/compression.zstd.rst:308 msgid "" "The *options* argument is a Python dictionary containing advanced " "decompression parameters. The valid keys and values for compression " "parameters are documented as part of the :class:`DecompressionParameter` " "documentation." msgstr "" #: ../../library/compression.zstd.rst:191 #: ../../library/compression.zstd.rst:313 msgid "" "The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " "trained data used during compression. This must be the same Zstandard " "dictionary used during compression." msgstr "" #: ../../library/compression.zstd.rst:195 msgid "" "If *data* is the concatenation of multiple distinct compressed frames, " "decompress all of these frames, and return the concatenation of the results." msgstr "" #: ../../library/compression.zstd.rst:201 msgid "" "Create a compressor object, which can be used to compress data incrementally." msgstr "" #: ../../library/compression.zstd.rst:204 msgid "" "For a more convenient way of compressing a single chunk of data, see the " "module-level function :func:`compress`." msgstr "" #: ../../library/compression.zstd.rst:220 msgid "" "The *zstd_dict* argument is an optional instance of :class:`ZstdDict` " "containing trained data to improve compression efficiency. The function :" "func:`train_dict` can be used to generate a Zstandard dictionary." msgstr "" #: ../../library/compression.zstd.rst:227 msgid "" "Compress *data* (a :term:`bytes-like object`), returning a :class:`bytes` " "object with compressed data if possible, or otherwise an empty :class:`!" "bytes` object. Some of *data* may be buffered internally, for use in later " "calls to :meth:`!compress` and :meth:`~.flush`. The returned data should be " "concatenated with the output of any previous calls to :meth:`~.compress`." msgstr "" #: ../../library/compression.zstd.rst:234 msgid "" "The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~." "CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." msgstr "" #: ../../library/compression.zstd.rst:238 msgid "" "When all data has been provided to the compressor, call the :meth:`~.flush` " "method to finish the compression process. If :meth:`~.compress` is called " "with *mode* set to :attr:`~.FLUSH_FRAME`, :meth:`~.flush` should not be " "called, as it would write out a new empty frame." msgstr "" #: ../../library/compression.zstd.rst:246 msgid "" "Finish the compression process, returning a :class:`bytes` object containing " "any data stored in the compressor's internal buffers." msgstr "" #: ../../library/compression.zstd.rst:249 msgid "" "The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~." "FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." msgstr "" #: ../../library/compression.zstd.rst:254 msgid "" "Specify the amount of uncompressed data *size* that will be provided for the " "next frame. *size* will be written into the frame header of the next frame " "unless :attr:`CompressionParameter.content_size_flag` is ``False`` or ``0``. " "A size of ``0`` means that the frame is empty. If *size* is ``None``, the " "frame header will omit the frame size. Frames that include the uncompressed " "data size require less memory to decompress, especially at higher " "compression levels." msgstr "" #: ../../library/compression.zstd.rst:262 msgid "" "If :attr:`last_mode` is not :attr:`FLUSH_FRAME`, a :exc:`ValueError` is " "raised as the compressor is not at the start of a frame. If the pledged size " "does not match the actual size of data provided to :meth:`.compress`, future " "calls to :meth:`!compress` or :meth:`flush` may raise :exc:`ZstdError` and " "the last chunk of data may be lost." msgstr "" #: ../../library/compression.zstd.rst:269 msgid "" "After :meth:`flush` or :meth:`.compress` are called with mode :attr:" "`FLUSH_FRAME`, the next frame will not include the frame size into the " "header unless :meth:`!set_pledged_input_size` is called again." msgstr "" #: ../../library/compression.zstd.rst:275 msgid "" "Collect more data for compression, which may or may not generate output " "immediately. This mode optimizes the compression ratio by maximizing the " "amount of data per block and frame." msgstr "" #: ../../library/compression.zstd.rst:281 msgid "" "Complete and write a block to the data stream. The data returned so far can " "be immediately decompressed. Past data can still be referenced in future " "blocks generated by calls to :meth:`~.compress`, improving compression." msgstr "" #: ../../library/compression.zstd.rst:288 msgid "" "Complete and write out a frame. Future data provided to :meth:`~.compress` " "will be written into a new frame and *cannot* reference past data." msgstr "" #: ../../library/compression.zstd.rst:294 msgid "" "The last mode passed to either :meth:`~.compress` or :meth:`~.flush`. The " "value can be one of :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~." "FLUSH_FRAME`. The initial value is :attr:`~.FLUSH_FRAME`, signifying that " "the compressor is at the start of a new frame." msgstr "" #: ../../library/compression.zstd.rst:302 msgid "" "Create a decompressor object, which can be used to decompress data " "incrementally." msgstr "" #: ../../library/compression.zstd.rst:305 msgid "" "For a more convenient way of decompressing an entire compressed stream at " "once, see the module-level function :func:`decompress`." msgstr "" #: ../../library/compression.zstd.rst:318 msgid "" "This class does not transparently handle inputs containing multiple " "compressed frames, unlike the :func:`decompress` function and :class:" "`ZstdFile` class. To decompress a multi-frame input, you should use :func:" "`decompress`, :class:`ZstdFile` if working with a :term:`file object`, or " "multiple :class:`!ZstdDecompressor` instances." msgstr "" #: ../../library/compression.zstd.rst:326 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " "to :meth:`!decompress`. The returned data should be concatenated with the " "output of any previous calls to :meth:`!decompress`." msgstr "" #: ../../library/compression.zstd.rst:332 msgid "" "If *max_length* is non-negative, the method returns at most *max_length* " "bytes of decompressed data. If this limit is reached and further output can " "be produced, the :attr:`~.needs_input` attribute will be set to ``False``. " "In this case, the next call to :meth:`~.decompress` may provide *data* as " "``b''`` to obtain more of the output." msgstr "" #: ../../library/compression.zstd.rst:339 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" #: ../../library/compression.zstd.rst:344 msgid "" "Attempting to decompress data after the end of a frame will raise a :exc:" "`EOFError`. Any data found after the end of the frame is ignored and saved " "in the :attr:`~.unused_data` attribute." msgstr "" #: ../../library/compression.zstd.rst:350 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" #: ../../library/compression.zstd.rst:354 msgid "Data found after the end of the compressed stream." msgstr "" #: ../../library/compression.zstd.rst:356 msgid "Before the end of the stream is reached, this will be ``b''``." msgstr "" #: ../../library/compression.zstd.rst:360 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new compressed input." msgstr "" #: ../../library/compression.zstd.rst:365 msgid "Zstandard dictionaries" msgstr "" #: ../../library/compression.zstd.rst:370 msgid "" "Train a Zstandard dictionary, returning a :class:`ZstdDict` instance. " "Zstandard dictionaries enable more efficient compression of smaller sizes of " "data, which is traditionally difficult to compress due to less repetition. " "If you are compressing multiple similar groups of data (such as similar " "files), Zstandard dictionaries can improve compression ratios and speed " "significantly." msgstr "" #: ../../library/compression.zstd.rst:377 msgid "" "The *samples* argument (an iterable of :class:`bytes` objects), is the " "population of samples used to train the Zstandard dictionary." msgstr "" #: ../../library/compression.zstd.rst:380 msgid "" "The *dict_size* argument, an integer, is the maximum size (in bytes) the " "Zstandard dictionary should be. The Zstandard documentation suggests an " "absolute maximum of no more than 100 KB, but the maximum can often be " "smaller depending on the data. Larger dictionaries generally slow down " "compression, but improve compression ratios. Smaller dictionaries lead to " "faster compression, but reduce the compression ratio." msgstr "" #: ../../library/compression.zstd.rst:390 msgid "" "An advanced function for converting a \"raw content\" Zstandard dictionary " "into a regular Zstandard dictionary. \"Raw content\" dictionaries are a " "sequence of bytes that do not need to follow the structure of a normal " "Zstandard dictionary." msgstr "" #: ../../library/compression.zstd.rst:395 msgid "" "The *zstd_dict* argument is a :class:`ZstdDict` instance with the :attr:" "`~ZstdDict.dict_content` containing the raw dictionary contents." msgstr "" #: ../../library/compression.zstd.rst:398 msgid "" "The *samples* argument (an iterable of :class:`bytes` objects), contains " "sample data for generating the Zstandard dictionary." msgstr "" #: ../../library/compression.zstd.rst:401 msgid "" "The *dict_size* argument, an integer, is the maximum size (in bytes) the " "Zstandard dictionary should be. See :func:`train_dict` for suggestions on " "the maximum dictionary size." msgstr "" #: ../../library/compression.zstd.rst:405 msgid "" "The *level* argument (an integer) is the compression level expected to be " "passed to the compressors using this dictionary. The dictionary information " "varies for each compression level, so tuning for the proper compression " "level can make compression more efficient." msgstr "" #: ../../library/compression.zstd.rst:413 msgid "" "A wrapper around Zstandard dictionaries. Dictionaries can be used to improve " "the compression of many small chunks of data. Use :func:`train_dict` if you " "need to train a new dictionary from sample data." msgstr "" #: ../../library/compression.zstd.rst:417 msgid "" "The *dict_content* argument (a :term:`bytes-like object`), is the already " "trained dictionary information." msgstr "" #: ../../library/compression.zstd.rst:420 msgid "" "The *is_raw* argument, a boolean, is an advanced parameter controlling the " "meaning of *dict_content*. ``True`` means *dict_content* is a \"raw " "content\" dictionary, without any format restrictions. ``False`` means " "*dict_content* is an ordinary Zstandard dictionary, created from Zstandard " "functions, for example, :func:`train_dict` or the external :program:`zstd` " "CLI." msgstr "" #: ../../library/compression.zstd.rst:426 msgid "" "When passing a :class:`!ZstdDict` to a function, the :attr:`!" "as_digested_dict` and :attr:`!as_undigested_dict` attributes can control how " "the dictionary is loaded by passing them as the ``zstd_dict`` argument, for " "example, ``compress(data, zstd_dict=zd.as_digested_dict)``. Digesting a " "dictionary is a costly operation that occurs when loading a Zstandard " "dictionary. When making multiple calls to compression or decompression, " "passing a digested dictionary will reduce the overhead of loading the " "dictionary." msgstr "" #: ../../library/compression.zstd.rst:435 msgid "Difference for compression" msgstr "" #: ../../library/compression.zstd.rst:440 msgid "Digested dictionary" msgstr "" #: ../../library/compression.zstd.rst:441 msgid "Undigested dictionary" msgstr "" #: ../../library/compression.zstd.rst:442 msgid "" "Advanced parameters of the compressor which may be overridden by the " "dictionary's parameters" msgstr "" #: ../../library/compression.zstd.rst:444 msgid "" "``window_log``, ``hash_log``, ``chain_log``, ``search_log``, ``min_match``, " "``target_length``, ``strategy``, ``enable_long_distance_matching``, " "``ldm_hash_log``, ``ldm_min_match``, ``ldm_bucket_size_log``, " "``ldm_hash_rate_log``, and some non-public parameters." msgstr "" #: ../../library/compression.zstd.rst:449 msgid "None" msgstr "None" #: ../../library/compression.zstd.rst:450 msgid ":class:`!ZstdDict` internally caches the dictionary" msgstr "" #: ../../library/compression.zstd.rst:451 msgid "" "Yes. It's faster when loading a digested dictionary again with the same " "compression level." msgstr "" #: ../../library/compression.zstd.rst:453 msgid "" "No. If you wish to load an undigested dictionary multiple times, consider " "reusing a compressor object." msgstr "" #: ../../library/compression.zstd.rst:456 msgid "" "If passing a :class:`!ZstdDict` without any attribute, an undigested " "dictionary is passed by default when compressing and a digested dictionary " "is generated if necessary and passed by default when decompressing." msgstr "" #: ../../library/compression.zstd.rst:462 msgid "" "The content of the Zstandard dictionary, a ``bytes`` object. It's the same " "as the *dict_content* argument in the ``__init__`` method. It can be used " "with other programs, such as the ``zstd`` CLI program." msgstr "" #: ../../library/compression.zstd.rst:468 msgid "Identifier of the Zstandard dictionary, a non-negative int value." msgstr "" #: ../../library/compression.zstd.rst:470 msgid "" "Non-zero means the dictionary is ordinary, created by Zstandard functions " "and following the Zstandard format." msgstr "" #: ../../library/compression.zstd.rst:473 msgid "" "``0`` means a \"raw content\" dictionary, free of any format restriction, " "used for advanced users." msgstr "" #: ../../library/compression.zstd.rst:478 msgid "" "The meaning of ``0`` for :attr:`!ZstdDict.dict_id` is different from the " "``dictionary_id`` attribute to the :func:`get_frame_info` function." msgstr "" #: ../../library/compression.zstd.rst:484 msgid "Load as a digested dictionary." msgstr "" #: ../../library/compression.zstd.rst:488 msgid "Load as an undigested dictionary." msgstr "" #: ../../library/compression.zstd.rst:492 msgid "Advanced parameter control" msgstr "" #: ../../library/compression.zstd.rst:496 msgid "" "An :class:`~enum.IntEnum` containing the advanced compression parameter keys " "that can be used when compressing data." msgstr "" #: ../../library/compression.zstd.rst:499 #: ../../library/compression.zstd.rst:733 msgid "" "The :meth:`~.bounds` method can be used on any attribute to get the valid " "values for that parameter." msgstr "" #: ../../library/compression.zstd.rst:502 msgid "" "Parameters are optional; any omitted parameter will have its value selected " "automatically." msgstr "" #: ../../library/compression.zstd.rst:505 msgid "" "Example getting the lower and upper bound of :attr:`~.compression_level`::" msgstr "" #: ../../library/compression.zstd.rst:507 msgid "lower, upper = CompressionParameter.compression_level.bounds()" msgstr "" #: ../../library/compression.zstd.rst:509 msgid "Example setting the :attr:`~.window_log` to the maximum size::" msgstr "" #: ../../library/compression.zstd.rst:511 msgid "" "_lower, upper = CompressionParameter.window_log.bounds()\n" "options = {CompressionParameter.window_log: upper}\n" "compress(b'venezuelan beaver cheese', options=options)" msgstr "" #: ../../library/compression.zstd.rst:517 msgid "" "Return the tuple of int bounds, ``(lower, upper)``, of a compression " "parameter. This method should be called on the attribute you wish to " "retrieve the bounds of. For example, to get the valid values for :attr:`~." "compression_level`, one may check the result of ``CompressionParameter." "compression_level.bounds()``." msgstr "" #: ../../library/compression.zstd.rst:523 #: ../../library/compression.zstd.rst:751 msgid "Both the lower and upper bounds are inclusive." msgstr "" #: ../../library/compression.zstd.rst:527 msgid "" "A high-level means of setting other compression parameters that affect the " "speed and ratio of compressing data." msgstr "" #: ../../library/compression.zstd.rst:530 msgid "" "Regular compression levels are greater than ``0``. Values greater than " "``20`` are considered \"ultra\" compression and require more memory than " "other levels. Negative values can be used to trade off faster compression " "for worse compression ratios." msgstr "" #: ../../library/compression.zstd.rst:535 msgid "Setting the level to zero uses :attr:`COMPRESSION_LEVEL_DEFAULT`." msgstr "" #: ../../library/compression.zstd.rst:539 msgid "" "Maximum allowed back-reference distance the compressor can use when " "compressing data, expressed as power of two, ``1 << window_log`` bytes. This " "parameter greatly influences the memory usage of compression. Higher values " "require more memory but gain better compression values." msgstr "" #: ../../library/compression.zstd.rst:544 #: ../../library/compression.zstd.rst:553 #: ../../library/compression.zstd.rst:564 #: ../../library/compression.zstd.rst:572 #: ../../library/compression.zstd.rst:583 #: ../../library/compression.zstd.rst:598 #: ../../library/compression.zstd.rst:629 #: ../../library/compression.zstd.rst:636 #: ../../library/compression.zstd.rst:644 #: ../../library/compression.zstd.rst:652 #: ../../library/compression.zstd.rst:711 #: ../../library/compression.zstd.rst:760 msgid "A value of zero causes the value to be selected automatically." msgstr "" #: ../../library/compression.zstd.rst:548 msgid "" "Size of the initial probe table, as a power of two. The resulting memory " "usage is ``1 << (hash_log+2)`` bytes. Larger tables improve compression " "ratio of strategies <= :attr:`~Strategy.dfast`, and improve compression " "speed of strategies > :attr:`~Strategy.dfast`." msgstr "" #: ../../library/compression.zstd.rst:557 msgid "" "Size of the multi-probe search table, as a power of two. The resulting " "memory usage is ``1 << (chain_log+2)`` bytes. Larger tables result in better " "and slower compression. This parameter has no effect for the :attr:" "`~Strategy.fast` strategy. It's still useful when using :attr:`~Strategy." "dfast` strategy, in which case it defines a secondary probe table." msgstr "" #: ../../library/compression.zstd.rst:568 msgid "" "Number of search attempts, as a power of two. More attempts result in better " "and slower compression. This parameter is useless for :attr:`~Strategy.fast` " "and :attr:`~Strategy.dfast` strategies." msgstr "" #: ../../library/compression.zstd.rst:576 msgid "" "Minimum size of searched matches. Larger values increase compression and " "decompression speed, but decrease ratio. Note that Zstandard can still find " "matches of smaller size, it just tweaks its search algorithm to look for " "this size and larger. For all strategies < :attr:`~Strategy.btopt`, the " "effective minimum is ``4``; for all strategies > :attr:`~Strategy.fast`, the " "effective maximum is ``6``." msgstr "" #: ../../library/compression.zstd.rst:587 msgid "The impact of this field depends on the selected :class:`Strategy`." msgstr "" #: ../../library/compression.zstd.rst:589 msgid "" "For strategies :attr:`~Strategy.btopt`, :attr:`~Strategy.btultra` and :attr:" "`~Strategy.btultra2`, the value is the length of a match considered \"good " "enough\" to stop searching. Larger values make compression ratios better, " "but compresses slower." msgstr "" #: ../../library/compression.zstd.rst:594 msgid "" "For strategy :attr:`~Strategy.fast`, it is the distance between match " "sampling. Larger values make compression faster, but with a worse " "compression ratio." msgstr "" #: ../../library/compression.zstd.rst:602 msgid "" "The higher the value of selected strategy, the more complex the compression " "technique used by zstd, resulting in higher compression ratios but slower " "compression." msgstr "" #: ../../library/compression.zstd.rst:606 msgid ":class:`Strategy`" msgstr "" #: ../../library/compression.zstd.rst:610 msgid "" "Long distance matching can be used to improve compression for large inputs " "by finding large matches at greater distances. It increases memory usage and " "window size." msgstr "" #: ../../library/compression.zstd.rst:614 msgid "" "``True`` or ``1`` enable long distance matching while ``False`` or ``0`` " "disable it." msgstr "" #: ../../library/compression.zstd.rst:617 msgid "" "Enabling this parameter increases default :attr:`~CompressionParameter." "window_log` to 128 MiB except when expressly set to a different value. This " "setting is enabled by default if :attr:`!window_log` >= 128 MiB and the " "compression strategy >= :attr:`~Strategy.btopt` (compression level 16+)." msgstr "" #: ../../library/compression.zstd.rst:625 msgid "" "Size of the table for long distance matching, as a power of two. Larger " "values increase memory usage and compression ratio, but decrease compression " "speed." msgstr "" #: ../../library/compression.zstd.rst:633 msgid "" "Minimum match size for long distance matcher. Larger or too small values can " "often decrease the compression ratio." msgstr "" #: ../../library/compression.zstd.rst:640 msgid "" "Log size of each bucket in the long distance matcher hash table for " "collision resolution. Larger values improve collision resolution but " "decrease compression speed." msgstr "" #: ../../library/compression.zstd.rst:648 msgid "" "Frequency of inserting/looking up entries into the long distance matcher " "hash table. Larger values improve compression speed. Deviating far from the " "default value will likely result in a compression ratio decrease." msgstr "" #: ../../library/compression.zstd.rst:656 msgid "" "Write the size of the data to be compressed into the Zstandard frame header " "when known prior to compressing." msgstr "" #: ../../library/compression.zstd.rst:659 msgid "This flag only takes effect under the following scenarios:" msgstr "" #: ../../library/compression.zstd.rst:661 msgid "Calling :func:`compress` for one-shot compression" msgstr "" #: ../../library/compression.zstd.rst:662 msgid "" "Providing all of the data to be compressed in the frame in a single :meth:" "`ZstdCompressor.compress` call, with the :attr:`ZstdCompressor.FLUSH_FRAME` " "mode." msgstr "" #: ../../library/compression.zstd.rst:665 msgid "" "Calling :meth:`ZstdCompressor.set_pledged_input_size` with the exact amount " "of data that will be provided to the compressor prior to any calls to :meth:" "`ZstdCompressor.compress` for the current frame. :meth:`!ZstdCompressor." "set_pledged_input_size` must be called for each new frame." msgstr "" #: ../../library/compression.zstd.rst:671 msgid "" "All other compression calls may not write the size information into the " "frame header." msgstr "" #: ../../library/compression.zstd.rst:674 msgid "" "``True`` or ``1`` enable the content size flag while ``False`` or ``0`` " "disable it." msgstr "" #: ../../library/compression.zstd.rst:679 msgid "" "A four-byte checksum using XXHash64 of the uncompressed content is written " "at the end of each frame. Zstandard's decompression code verifies the " "checksum. If there is a mismatch a :class:`ZstdError` exception is raised." msgstr "" #: ../../library/compression.zstd.rst:684 msgid "" "``True`` or ``1`` enable checksum generation while ``False`` or ``0`` " "disable it." msgstr "" #: ../../library/compression.zstd.rst:689 msgid "" "When compressing with a :class:`ZstdDict`, the dictionary's ID is written " "into the frame header." msgstr "" #: ../../library/compression.zstd.rst:692 msgid "" "``True`` or ``1`` enable storing the dictionary ID while ``False`` or ``0`` " "disable it." msgstr "" #: ../../library/compression.zstd.rst:697 msgid "" "Select how many threads will be spawned to compress in parallel. When :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." msgstr "" #: ../../library/compression.zstd.rst:702 msgid "A value of zero disables multi-threading." msgstr "" #: ../../library/compression.zstd.rst:706 msgid "" "Size of a compression job, in bytes. This value is enforced only when :attr:" "`~CompressionParameter.nb_workers` >= 1. Each compression job is completed " "in parallel, so this value can indirectly impact the number of active " "threads." msgstr "" #: ../../library/compression.zstd.rst:715 msgid "" "Sets how much data is reloaded from previous jobs (threads) for new jobs to " "be used by the look behind window during compression. This value is only " "used when :attr:`~CompressionParameter.nb_workers` >= 1. Acceptable values " "vary from 0 to 9." msgstr "" #: ../../library/compression.zstd.rst:720 msgid "0 means dynamically set the overlap amount" msgstr "" #: ../../library/compression.zstd.rst:721 msgid "1 means no overlap" msgstr "" #: ../../library/compression.zstd.rst:722 msgid "9 means use a full window size from the previous job" msgstr "" #: ../../library/compression.zstd.rst:724 msgid "" "Each increment halves/doubles the overlap size. \"8\" means an overlap of " "``window_size/2``, \"7\" means an overlap of ``window_size/4``, etc." msgstr "" #: ../../library/compression.zstd.rst:729 msgid "" "An :class:`~enum.IntEnum` containing the advanced decompression parameter " "keys that can be used when decompressing data. Parameters are optional; any " "omitted parameter will have its value selected automatically." msgstr "" #: ../../library/compression.zstd.rst:736 msgid "Example setting the :attr:`~.window_log_max` to the maximum size::" msgstr "" #: ../../library/compression.zstd.rst:738 msgid "" "data = compress(b'Some very long buffer of bytes...')\n" "\n" "_lower, upper = DecompressionParameter.window_log_max.bounds()\n" "\n" "options = {DecompressionParameter.window_log_max: upper}\n" "decompress(data, options=options)" msgstr "" #: ../../library/compression.zstd.rst:747 msgid "" "Return the tuple of int bounds, ``(lower, upper)``, of a decompression " "parameter. This method should be called on the attribute you wish to " "retrieve the bounds of." msgstr "" #: ../../library/compression.zstd.rst:755 msgid "" "The base-two logarithm of the maximum size of the window used during " "decompression. This can be useful to limit the amount of memory used when " "decompressing data. A larger maximum window size leads to faster " "decompression." msgstr "" #: ../../library/compression.zstd.rst:765 msgid "" "An :class:`~enum.IntEnum` containing strategies for compression. Higher-" "numbered strategies correspond to more complex and slower compression." msgstr "" #: ../../library/compression.zstd.rst:771 msgid "" "The values of attributes of :class:`!Strategy` are not necessarily stable " "across zstd versions. Only the ordering of the attributes may be relied " "upon. The attributes are listed below in order." msgstr "" #: ../../library/compression.zstd.rst:775 msgid "The following strategies are available:" msgstr "" #: ../../library/compression.zstd.rst:797 msgid "Miscellaneous" msgstr "" #: ../../library/compression.zstd.rst:801 msgid "" "Retrieve a :class:`FrameInfo` object containing metadata about a Zstandard " "frame. Frames contain metadata related to the compressed data they hold." msgstr "" #: ../../library/compression.zstd.rst:807 msgid "Metadata related to a Zstandard frame." msgstr "" #: ../../library/compression.zstd.rst:811 msgid "The size of the decompressed contents of the frame." msgstr "" #: ../../library/compression.zstd.rst:815 msgid "" "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." msgstr "" #: ../../library/compression.zstd.rst:823 msgid "The default compression level for Zstandard: ``3``." msgstr "" #: ../../library/compression.zstd.rst:828 msgid "" "Version number of the runtime zstd library as a tuple of integers (major, " "minor, release)." msgstr "" #: ../../library/compression.zstd.rst:833 msgid "Examples" msgstr "Beispiele" #: ../../library/compression.zstd.rst:835 msgid "Reading in a compressed file:" msgstr "" #: ../../library/compression.zstd.rst:837 msgid "" "from compression import zstd\n" "\n" "with zstd.open(\"file.zst\") as f:\n" " file_content = f.read()" msgstr "" #: ../../library/compression.zstd.rst:844 msgid "Creating a compressed file:" msgstr "" #: ../../library/compression.zstd.rst:846 msgid "" "from compression import zstd\n" "\n" "data = b\"Insert Data Here\"\n" "with zstd.open(\"file.zst\", \"w\") as f:\n" " f.write(data)" msgstr "" #: ../../library/compression.zstd.rst:854 msgid "Compressing data in memory:" msgstr "" #: ../../library/compression.zstd.rst:856 msgid "" "from compression import zstd\n" "\n" "data_in = b\"Insert Data Here\"\n" "data_out = zstd.compress(data_in)" msgstr "" #: ../../library/compression.zstd.rst:863 msgid "Incremental compression:" msgstr "" #: ../../library/compression.zstd.rst:865 msgid "" "from compression import zstd\n" "\n" "comp = zstd.ZstdCompressor()\n" "out1 = comp.compress(b\"Some data\\n\")\n" "out2 = comp.compress(b\"Another piece of data\\n\")\n" "out3 = comp.compress(b\"Even more data\\n\")\n" "out4 = comp.flush()\n" "# Concatenate all the partial results:\n" "result = b\"\".join([out1, out2, out3, out4])" msgstr "" #: ../../library/compression.zstd.rst:877 msgid "Writing compressed data to an already-open file:" msgstr "" #: ../../library/compression.zstd.rst:879 msgid "" "from compression import zstd\n" "\n" "with open(\"myfile\", \"wb\") as f:\n" " f.write(b\"This data will not be compressed\\n\")\n" " with zstd.open(f, \"w\") as zstf:\n" " zstf.write(b\"This *will* be compressed\\n\")\n" " f.write(b\"Not compressed\\n\")" msgstr "" #: ../../library/compression.zstd.rst:889 msgid "Creating a compressed file using compression parameters:" msgstr "" #: ../../library/compression.zstd.rst:891 msgid "" "from compression import zstd\n" "\n" "options = {\n" " zstd.CompressionParameter.checksum_flag: 1\n" "}\n" "with zstd.open(\"file.zst\", \"w\", options=options) as f:\n" " f.write(b\"Mind if I squeeze in?\")" msgstr ""