+
    Brh7"                        R t Rt^ RIt^ RIt^ RIHtHtHtHtHtH	t	 ^ RI
HtHtHt . ]! ]P                  ^d,          ^d4      O]P                  ^d,          N5t ]P"                  t  ! R R4      tR	 tR
 tR tRR ltRR lt ! R R]P2                  4      t ! R R]P2                  4      t ! R R]P2                  4      t]P:                  ! ]]4       R# )zGPython bindings to the Zstandard (zstd) compression library (RFC-8878).CompressionParameterDecompressionParameterStrategyN)ZstdCompressorZstdDecompressorZstdDict	ZstdErrorget_frame_sizezstd_version)ZstdFileopen_nbytesc                   F   a a ] tR t^,t oRtRtV 3R ltR tR tRt	Vt
V ;t# )	FrameInfoz$Information about a Zstandard frame.c                H   < \         SV `  R V4       \         SV `  RV4       R# )decompressed_sizedictionary_idN)super__setattr__)selfr   r   	__class__s   &&&6/usr/local/lib/python3.14/compression/zstd/__init__.py__init__FrameInfo.__init__1   s#    /1BCO];    c                <    R V P                    RV P                   R2# )zFrameInfo(decompressed_size=z, dictionary_id=)r   r   r   s   &r   __repr__FrameInfo.__repr__5   s.    .t/E/E.F G!!%!3!3 4A7 	8r   c                     \        R V: 24      h)zcan't set attribute )AttributeError)r   name_s   &&&r   r   FrameInfo.__setattr__9   s    3D8<==r    r   )__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r   ,   s!     .4I<8> >r   r   c                <    \        \        P                  ! V 4      !  # )ay  Get Zstandard frame information from a frame header.

*frame_buffer* is a bytes-like object. It should start from the beginning
of a frame, and needs to include at least the frame header (6 to 18 bytes).

The returned FrameInfo object has two attributes.
'decompressed_size' is the size in bytes of the data in the frame when
decompressed, or None when the decompressed size is unknown.
'dictionary_id' is an int in the range (0, 2**32). The special value 0
means that the dictionary ID was not recorded in the frame header,
the frame may or may not need a dictionary to be decoded,
and the ID of such a dictionary is not specified.
)r   _zstdget_frame_info)frame_buffers   &r   r3   r3   =   s     e**<899r   c                r   \        V\        4      '       g&   \        V4      P                  p\	        RV: R24      h\        V 4      p RP                  V 4      p\
        ;QJ d    . R V  4       F  NK  	  5M! R V  4       4      pV'       g   \        R4      h\        P                  ! W4V4      p\        V4      # )zReturn a ZstdDict representing a trained Zstandard dictionary.

*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.
z%dict_size must be an int object, not .r   c              3   8   "   T F  p\        V4      x  K  	  R # 5iNr   .0samples   & r   	<genexpr>train_dict.<locals>.<genexpr>\        >gFg   z2samples contained no data; can't train dictionary.)
isinstanceinttyper)   	TypeErrortuplejoin
ValueErrorr2   
train_dictr   )samples	dict_sizeds_clschunkschunk_sizesdict_contents   &&    r   rH   rH   N   s     i%%i--?zKLLGnGXXgF%>g>%%>g>>KMNN##FCLL!!r   c                  \        V \        4      '       g   \        R4      h\        V\        4      '       g   \        R4      h\        V\        4      '       g   \        R4      h\	        V4      pRP                  V4      p\        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      pV'       g   \        R4      h\        P                  ! V P                  VWRV4      p\        V4      # )a  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.
z/zstd_dict argument should be a ZstdDict object.z+dict_size argument should be an int object.z'level argument should be an int object.r   c              3   8   "   T F  p\        V4      x  K  	  R # 5ir8   r9   r:   s   & r   r=    finalize_dict.<locals>.<genexpr>   r?   r@   z=The samples are empty content, can't finalize the dictionary.)
rA   r   rD   rB   rE   rF   rG   r2   finalize_dictrN   )	zstd_dictrI   rJ   levelrL   rM   rN   s   "&&&   r   rR   rR   c   s    & i**IJJi%%EFFeS!!ABBGnGXXgF%>g>%%>g>>K ' ( 	(&&y'='=v'2uFLL!!r   c                ^    \        WVR7      pVP                  V \         P                  R7      # )a  Return Zstandard compressed *data* as bytes.

*level* is an int specifying the compression level to use, defaulting to
COMPRESSION_LEVEL_DEFAULT ('3').
*options* is a dict object that contains advanced compression
parameters. See CompressionParameter for more on options.
*zstd_dict* is a ZstdDict object, a pre-trained Zstandard dictionary. See
the function train_dict for how to train a ZstdDict on sample data.

For incremental compression, use a ZstdCompressor instead.
)rT   optionsrS   )mode)r   compressFLUSH_FRAME)datarT   rV   rS   comps   &&&& r   rX   rX      s)     )LD==N$>$>=??r   c                    . p \        W!R7      pVP                  VP                  V 4      4       VP                  '       g   \	        R4      hVP
                  p V '       d   K`   RP                  T4      # )a  Decompress one or more frames of Zstandard compressed *data*.

*zstd_dict* is a ZstdDict object, a pre-trained Zstandard dictionary. See
the function train_dict for how to train a ZstdDict on sample data.
*options* is a dict object that contains advanced compression
parameters. See DecompressionParameter for more on options.

For incremental decompression, use a ZstdDecompressor instead.
)rV   rS   zACompressed data ended before the end-of-stream marker was reachedr   )r   append
decompresseofr   unused_datarF   )rZ   rS   rV   resultsdecomps   &&&  r   r^   r^      sl     G
!'Gv((./zzz ? @ @!!t88Gr   c                     a  ] tR t^t o Rt]P                  t]P                  t	]P                  t]P                  t]P                  t]P                   t]P$                  t]P(                  t]P,                  t]P0                  t]P4                  t]P8                  t]P<                  t]P@                  t!]PD                  t#]PH                  t%]PL                  t']PP                  t)]PT                  t+R t,Rt-V t.R# )r   zCompression parameters.c                F    \         P                  ! V P                  RR7      # )zqReturn the (lower, upper) int bounds of a compression parameter.

Both the lower and upper bounds are inclusive.
Tis_compressr2   get_param_boundsvaluer   s   &r   boundsCompressionParameter.bounds   s    
 %%djjdCCr   r&   N)/r'   r(   r)   r*   r+   r2   ZSTD_c_compressionLevelcompression_levelZSTD_c_windowLog
window_logZSTD_c_hashLoghash_logZSTD_c_chainLog	chain_logZSTD_c_searchLog
search_logZSTD_c_minMatch	min_matchZSTD_c_targetLengthtarget_lengthZSTD_c_strategystrategy!ZSTD_c_enableLongDistanceMatchingenable_long_distance_matchingZSTD_c_ldmHashLogldm_hash_logZSTD_c_ldmMinMatchldm_min_matchZSTD_c_ldmBucketSizeLogldm_bucket_size_logZSTD_c_ldmHashRateLogldm_hash_rate_logZSTD_c_contentSizeFlagcontent_size_flagZSTD_c_checksumFlagchecksum_flagZSTD_c_dictIDFlagdict_id_flagZSTD_c_nbWorkers
nb_workersZSTD_c_jobSizejob_sizeZSTD_c_overlapLogoverlap_logrj   r-   r.   r0   s   @r   r   r      s     !55''J##H%%I''J%%I--M$$H$)$K$K!**L,,M773344--M**L''J##H))KD Dr   c                   B   a  ] tR t^t o Rt]P                  tR tRt	V t
R# )r   zDecompression parameters.c                F    \         P                  ! V P                  RR7      # )zsReturn the (lower, upper) int bounds of a decompression parameter.

Both the lower and upper bounds are inclusive.
Fre   rg   r   s   &r   rj   DecompressionParameter.bounds   s    
 %%djjeDDr   r&   N)r'   r(   r)   r*   r+   r2   ZSTD_d_windowLogMaxwindow_log_maxrj   r-   r.   r   s   @r   r   r      s     #..NE Er   c                       ] tR t^tRt]P                  t]P                  t	]P                  t]P                  t]P                  t]P                   t]P$                  t]P(                  t]P,                  tRtR# )r   zCompression strategies, listed from fastest to strongest.

Note that new strategies might be added in the future.
Only the order (from fast to strong) is guaranteed,
the numeric value might change.
r&   N)r'   r(   r)   r*   r+   r2   	ZSTD_fastfast
ZSTD_dfastdfastZSTD_greedygreedy	ZSTD_lazylazy
ZSTD_lazy2lazy2ZSTD_btlazy2btlazy2
ZSTD_btoptbtoptZSTD_btultrabtultraZSTD_btultra2btultra2r-   r&   r   r   r   r      sh     ??DEF??DE  GE  G""Hr   )COMPRESSION_LEVEL_DEFAULTrX   r   r^   r   rR   r3   r   rH   r   r   r	   r
   zstd_version_infor   r   r   r   )NNN)NN)r+   __all__r2   enumr   r   r   r   r	   r
   compression.zstd._zstdfiler   r   r   divmodzstd_version_numberr   ZSTD_CLEVEL_DEFAULTr   r   r3   rH   rR   rX   r^   IntEnumr   r   r   set_parameter_typesr&   r   r   <module>r      s    M4  1 1 > >6fU66#=sC 6..46  H!55  A> >":""*""J@ .D4<< DD
ET\\ 
E#t|| #(   .0F Gr   