| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/pyarrow.Codec.html | [Back] [Original] |
Bases: _Weakrefable
Compression codec.
strType of compression codec to initialize, valid values are: gzip, bz2, brotli, lz4 (or lz4_frame), lz4_raw, zstd and snappy.
int, NoneOptional parameter specifying how aggressively to compress. The possible ranges and effect of this parameter depend on the specific codec chosen. Higher values compress more but typically use more resources (CPU/RAM). Some codecs support negative values.
The compression_level maps to the memlevel parameter of deflateInit2. Higher levels use more RAM but are faster and should have higher compression ratios.
The compression level maps to the blockSize100k parameter of the BZ2_bzCompressInit function. Higher levels use more RAM but are faster and should have higher compression ratios.
The compression level maps to the BROTLI_PARAM_QUALITY parameter. Higher values are slower and should have higher compression ratios.
The compression level parameter is not supported and must be None
The compression level maps to the compressionLevel parameter of ZSTD_initCStream. Negative values are supported. Higher values are slower and should have higher compression ratios.
The compression level parameter is not supported and must be None
ValueErrorIf invalid compression value is passed.
Examples
>>> import pyarrow as pa
>>> pa.Codec.is_available('gzip')
True
>>> codec = pa.Codec('gzip')
>>> codec.name
'gzip'
>>> codec.compression_level
9
Methods
|
|
|
Compress data from buffer-like object. |
|
Decompress data from buffer-like object. |
|
Returns the compression level that Arrow will use for the codec if None is specified. |
|
Detect and instantiate compression codec based on file extension. |
|
Returns whether the compression support has been built and enabled. |
|
Returns the largest valid value for the compression level |
|
Returns the smallest valid value for the compression level |
|
Returns true if the compression level parameter is supported for the given codec. |
Attributes
Returns the compression level parameter of the codec |
|
Returns the name of the codec |
Compress data from buffer-like object.
pyarrow.Buffer, bytes, or other object supporting buffer protocolFalseReturn result as Python bytes object, otherwise Buffer
MemoryPool, default NoneMemory pool to use for buffer allocations, if any
pyarrow.Buffer or bytes (if asbytes=True)Returns the compression level parameter of the codec
Decompress data from buffer-like object.
pyarrow.Buffer, bytes, or memoryview-compatible objectint, default NoneSize of the decompressed result
FalseReturn result as Python bytes object, otherwise Buffer
MemoryPool, default NoneMemory pool to use for buffer allocations, if any.
pyarrow.Buffer or bytes (if asbytes=True)Returns the compression level that Arrow will use for the codec if None is specified.
strType of compression codec, refer to Codec docstring for a list of supported ones.
Detect and instantiate compression codec based on file extension.
str, path-likeFile-path to detect compression from.
TypeErrorIf the passed value is not path-like.
ValueErrorIf the compression cant be detected from the path.
Returns whether the compression support has been built and enabled.
Returns the largest valid value for the compression level
strType of compression codec, refer to Codec docstring for a list of supported ones.
Returns the smallest valid value for the compression level
strType of compression codec, refer to Codec docstring for a list of supported ones.
Returns the name of the codec
| Web Proxy Viewer | New URL | Original Page |