@@ -138,10 +138,9 @@ Reading and writing compressed files
138138
139139 ``'rb' `` for reading and ``'wb' `` for writing.
140140
141-
142141 .. attribute :: name
143142
144- The zstd file name . Equivalent to the :attr: `~io.FileIO.name `
143+ The name of the Zstandard file . Equivalent to the :attr: `~io.FileIO.name `
145144 attribute of the underlying :term: `file object `.
146145
147146
@@ -542,8 +541,7 @@ Advanced parameter control
542541 compression technique used by zstd, resulting in higher compression
543542 ratios but slower compression.
544543
545- .. seealso ::
546- :class: `Strategy `
544+ .. seealso :: :class:`Strategy`
547545
548546 .. attribute :: enable_long_distance_matching
549547
@@ -684,11 +682,11 @@ Miscellaneous
684682
685683.. function :: get_frame_info(frame_buffer)
686684
687- Retrieve a :class: `FrameInfo `, containing metadata about a Zstandard frame.
688- Frames contain metadata related to the compressed data they hold.
685+ Retrieve a :class: `FrameInfo ` object containing metadata about a Zstandard
686+ frame. Frames contain metadata related to the compressed data they hold.
689687
690688
691- .. class :: FrameInfo()
689+ .. class :: FrameInfo
692690
693691 Metadata related to a Zstandard frame. There are currently two attributes
694692 containing metadata related to Zstandard frames.
@@ -712,34 +710,38 @@ Miscellaneous
712710
713711.. attribute :: zstd_version_info
714712
715- Version number of the runtime zstd library as a tuple of int
713+ Version number of the runtime zstd library as a tuple of integers
716714 (major, minor, release).
717715
718716
719717Examples
720718--------
721719
722- Reading in a compressed file::
720+ Reading in a compressed file:
723721
722+ .. code-block :: python
724723 from compression import zstd
725724 with zstd.open(" file.zst" ) as f:
726725 file_content = f.read()
727726
728- Creating a compressed file::
727+ Creating a compressed file:
729728
729+ .. code-block :: python
730730 from compression import zstd
731731 data = b " Insert Data Here"
732732 with zstd.open(" file.zst" , " w" ) as f:
733733 f.write(data)
734734
735- Compressing data in memory::
735+ Compressing data in memory:
736736
737+ .. code-block :: python
737738 from compression import zstd
738739 data_in = b " Insert Data Here"
739740 data_out = zstd.compress(data_in)
740741
741- Incremental compression::
742+ Incremental compression:
742743
744+ .. code-block :: python
743745 from compression import zstd
744746 comp = zstd.ZstdCompressor()
745747 out1 = comp.compress(b " Some data\n " )
@@ -749,17 +751,19 @@ Incremental compression::
749751 # Concatenate all the partial results:
750752 result = b " " .join([out1, out2, out3, out4])
751753
752- Writing compressed data to an already-open file::
754+ Writing compressed data to an already-open file:
753755
756+ .. code-block :: python
754757 from compression import zstd
755758 with open (" file.zst" , " wb" ) as f:
756759 f.write(b " This data will not be compressed\n " )
757760 with zstd.open(f, " w" ) as zstf:
758761 zstf.write(b " This *will* be compressed\n " )
759762 f.write(b " Not compressed\n " )
760763
761- Creating a compressed file using compression parameters::
764+ Creating a compressed file using compression parameters:
762765
766+ .. code-block :: python
763767 from compression import zstd
764768 options = {
765769 zstd.CompressionParameter.checksum_flag: 1
0 commit comments