Skip to content

Commit a8e40ba

Browse files
committed
Add documentation string to the igzip_lib module
1 parent 5270039 commit a8e40ba

File tree

5 files changed

+73
-40
lines changed

5 files changed

+73
-40
lines changed

docs/includes/igzip.rst

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/includes/isal.igzip_usage.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/includes/isal_zlib.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/index.rst

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,40 @@ Differences with zlib and gzip modules
5454
:start-after: .. differences start
5555
:end-before: .. differences end
5656

57-
.. include:: includes/isal_zlib.rst
57+
============================
58+
API Documentation: igzip_lib
59+
============================
5860

59-
.. include:: includes/igzip.rst
61+
.. automodule:: isal.igzip_lib
62+
:members:
63+
64+
============================
65+
API Documentation: isal_zlib
66+
============================
67+
68+
.. automodule:: isal.isal_zlib
69+
:members:
70+
71+
========================
72+
API-documentation: igzip
73+
========================
74+
75+
.. automodule:: isal.igzip
76+
:members: compress, decompress, open
77+
78+
.. autoclass:: IGzipFile
79+
:members:
80+
:special-members: __init__
81+
82+
==========================
83+
python -m isal.igzip usage
84+
==========================
85+
86+
.. argparse::
87+
:module: isal.igzip
88+
:func: _argument_parser
89+
:prog: python -m isal.igzip
6090

61-
.. include:: includes/isal.igzip_usage.rst
6291

6392
============
6493
Contributing

src/isal/igzip_lib.pyx

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,60 @@
2121
# cython: language_level=3
2222
# cython: binding=True
2323

24-
from libc.stdint cimport UINT64_MAX, UINT32_MAX
25-
from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free
26-
from cpython.buffer cimport PyBUF_C_CONTIGUOUS, PyObject_GetBuffer, PyBuffer_Release
27-
from cpython.bytes cimport PyBytes_FromStringAndSize
28-
29-
cdef extern from "<Python.h>":
30-
const Py_ssize_t PY_SSIZE_T_MAX
31-
3224
"""
3325
Pythonic interface to ISA-L's igzip_lib.
3426
3527
This module comes with the following constants:
36-
============================== ================================================
37-
Constant Meaning
28+
3829
============================== ================================================
3930
``ISAL_BEST_SPEED`` The lowest compression level (0)
4031
``ISAL_BEST_COMPRESSION`` The highest compression level (3)
4132
``ISAL_DEFAULT_COMPRESSION`` The compromise compression level (2)
4233
``DEF_BUF_SIZE`` Default size for the starting buffer (16K)
4334
``MAX_HIST_BITS`` Maximum window size bits (15).
4435
``COMP_DEFLATE`` Flag to compress to a raw deflate block
45-
``COMP_GZIP`` Flag to compress a gzip block, consisting of a
46-
gzip header, raw deflate block and a gzip
36+
``COMP_GZIP`` Flag to compress a gzip block, consisting of a
37+
gzip header, raw deflate block and a gzip
38+
trailer.
39+
``COMP_GZIP_NO_HDR`` Flag to compress a gzip block without a header.
40+
``COMP_ZLIB`` Flag to compress a zlib block, consisting of a
41+
zlib header, a raw deflate block and a zlib
42+
trailer.
43+
``COMP_ZLIB_NO_HDR`` Flag to compress a zlib block without a header.
44+
``DECOMP_DEFLATE`` Flag to decompress a raw deflate block.
45+
``DECOMP_GZIP`` Flag to decompress a gzip block including header
46+
and verify the checksums in the trailer.
47+
``DECOMP_GZIP_NO_HDR`` Flag to decompress a gzip block without a header
48+
and verify the checksums in the trailer.
49+
``DECOMP_GZIP_NO_HDR_VER`` Flag to decompress a gzip block without a header
50+
and without verifying the checksums in the
4751
trailer.
48-
``COMP_GZIP_NO_HDR`` Compress
52+
``DECOMP_ZLIB`` Flag to decompress a zlib block including header
53+
and verify the checksums in the trailer.
54+
``DECOMP_ZLIB_NO_HDR`` Flag to decompress a zlib block without a header
55+
and verify the checksums in the trailer.
56+
``DECOMP_ZLIB_NO_HDR_VER`` Flag to decompress a zlib block without a header
57+
and without verifying the checksums in the
58+
trailer.
59+
``MEM_LEVEL_DEFAULT`` The default memory level for the internal level
60+
buffer. (Equivalent to
61+
MEM_LEVEL_LARGE.)
62+
``MEM_LEVEL_MIN`` The minimum memory level.
63+
``MEM_LEVEL_SMALL``
64+
``MEM_LEVEL_MEDIUM``
65+
``MEM_LEVEL_LARGE``
66+
``MEM_LEVEL_EXTRA_LARGE`` The largest memory level.
67+
============================== ================================================
4968
"""
69+
70+
from libc.stdint cimport UINT64_MAX, UINT32_MAX
71+
from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free
72+
from cpython.buffer cimport PyBUF_C_CONTIGUOUS, PyObject_GetBuffer, PyBuffer_Release
73+
from cpython.bytes cimport PyBytes_FromStringAndSize
74+
75+
cdef extern from "<Python.h>":
76+
const Py_ssize_t PY_SSIZE_T_MAX
77+
5078
ISAL_BEST_SPEED = ISAL_DEF_MIN_LEVEL
5179
ISAL_BEST_COMPRESSION = ISAL_DEF_MAX_LEVEL
5280
cdef int ISAL_DEFAULT_COMPRESSION_I = 2

0 commit comments

Comments
 (0)