Skip to content

Commit bbd26e8

Browse files
authored
Merge pull request #72 from pycompression/more_docs
Add extensive documentation
2 parents 2a60a08 + dcbbe95 commit bbd26e8

File tree

13 files changed

+209
-67
lines changed

13 files changed

+209
-67
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11

22
### Checklist
33
- [ ] Pull request details were added to CHANGELOG.rst
4+
- [ ] Documentation was updated (if needed)

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Changelog
77
.. This document is user facing. Please word the changes in such a way
88
.. that users understand how the changes affect the new version.
99
10+
version 0.10.0-dev
11+
------------------
12+
+ Added more extensive documentation.
13+
1014
version 0.9.0
1115
-----------------
1216
+ Fix a bug where a AttributeError was triggered when zlib.Z_RLE or

README.rst

Lines changed: 59 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
python-isal
3535
===========
3636

37+
.. introduction start
38+
3739
Faster zlib and gzip compatible compression and decompression
3840
by providing Python bindings for the ISA-L library.
3941

@@ -47,8 +49,12 @@ a variety of functions to provide zlib/gzip-compatible compression.
4749
``igzip`` module which are usable as drop-in replacements for the ``zlib``
4850
and ``gzip`` modules from the stdlib (with some minor exceptions, see below).
4951

50-
Usage
51-
-----
52+
.. introduction end
53+
54+
Quickstart
55+
----------
56+
57+
.. usage start
5258
5359
Python-isal has faster versions of the stdlib's ``zlib`` and ``gzip`` module
5460
these are called ``isal_zlib`` and ``igzip`` respectively.
@@ -68,65 +74,26 @@ A full API documentation can be found on `our readthedocs page
6874
<https://python-isal.readthedocs.io>`_.
6975

7076
``python -m isal.igzip`` implements a simple gzip-like command line
71-
application (just like ``python -m gzip``).
72-
73-
Installation
74-
------------
75-
Installation with pip
76-
.....................
77-
78-
::
79-
80-
pip install isal
81-
82-
Installation is supported on Linux, MacOS and Windows. On x86-64 (amd64)
83-
platforms wheels are provided, so installation should be almost instantaneous.
84-
The installation will include a staticallly linked version of ISA-L.
85-
If a wheel is not provided for your system the
86-
installation will build ISA-L first in a temporary directory. Please check the
87-
`ISA-L homepage <https://github.com/intel/isa-l>`_ for the build requirements.
88-
89-
The latest development version of python-isal can be installed with::
90-
91-
pip install git+https://github.com/rhpvorderman/python-isal.git
77+
application (just like ``python -m gzip``). Full usage documentation can be
78+
found on `our readthedocs page <https://python-isal.readthedocs.io>`_.
9279

93-
This requires having the build requirements installed.
94-
If you wish to link
95-
dynamically against a version of libisal installed on your system use::
9680

97-
PYTHON_ISAL_LINK_DYNAMIC=true pip install isal --no-binary isal
81+
.. usage end
9882
99-
ISA-L is available in numerous Linux distro's as well as on conda via the
100-
conda-forge channel. Checkout the `ports documentation
101-
<https://github.com/intel/isa-l/wiki/Ports--Repos>`_ on the ISA-L project wiki
102-
to find out how to install it. It is important that the development headers
103-
are also installed.
104-
105-
On Debian and Ubuntu the ISA-L libraries (including the development headers)
106-
can be installed with::
107-
108-
sudo apt install libisal-dev
109-
110-
Installation via conda
111-
..................................
112-
Python-isal can be installed via conda, for example using
113-
the `miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ installer
114-
with a properly setup `conda-forge
115-
<https://conda-forge.org/docs/user/introduction.html#how-can-i-install-packages-from-conda-forge>`_
116-
channel. When used with bioinformatics tools setting up `bioconda
117-
<http://bioconda.github.io/user/install.html#install-conda>`_
118-
provides a clear set of installation instructions for conda.
119-
120-
python-isal is available on conda-forge and can be installed with::
121-
122-
conda install python-isal
83+
Installation
84+
------------
85+
- with pip: ``pip install isal``
86+
- with conda: ``conda install python-isal``
12387

124-
This will automatically install the ISA-L library dependency as well, since
125-
it is available on conda-forge.
88+
Installation is supported on Linux, Windows and MacOS. For more advanced
89+
installation options check the `documentation
90+
<https://python-isal.readthedocs.io/en/stable/index.html#installation>`_.
12691

12792
Differences with zlib and gzip modules
12893
--------------------------------------
12994

95+
.. differences start
96+
13097
+ Compression level 0 in ``zlib`` and ``gzip`` means **no compression**, while
13198
in ``isal_zlib`` and ``igzip`` this is the **lowest compression level**.
13299
This is a design choice that was inherited from the ISA-L library.
@@ -151,8 +118,47 @@ Differences with zlib and gzip modules
151118
to reflect this. ``igzip.GzipFile`` does exist as an alias of
152119
``igzip.IGzipFile`` for compatibility reasons.
153120

121+
.. differences end
122+
154123
Contributing
155124
------------
125+
.. contributing start
126+
156127
Please make a PR or issue if you feel anything can be improved. Bug reports
157128
are also very welcome. Please report them on the `github issue tracker
158129
<https://github.com/rhpvorderman/python-isal/issues>`_.
130+
131+
.. contributing end
132+
133+
Acknowledgements
134+
----------------
135+
136+
.. acknowledgements start
137+
138+
This project builds upon the software and experience of many. Many thanks to:
139+
140+
+ The `ISA-L contributors
141+
<https://github.com/intel/isa-l/graphs/contributors>`_ for making ISA-L.
142+
+ The `Cython contributors
143+
<https://github.com/cython/cython/graphs/contributors>`_ for making it easy
144+
to create an extension and helping a novice get start with pointer addresses.
145+
+ The `CPython contributors
146+
<https://github.com/python/cpython/graphs/contributors>`_.
147+
Python-isal mimicks ``zlibmodule.c`` and ``igzip.py`` to make it easier for
148+
python users to adopt it.
149+
+ `@marcelm <https://github.com/marcelm>`_ for taking a chance on this project
150+
and make it a dependency for his `xopen
151+
<https://github.com/pycompression/xopen>`_ and by extension `cutadapt
152+
<https://github.com/marcelm/cutadapt>`_ projects. This gave python-isal its
153+
first users who used python-isal in production.
154+
+ The `github actions team <https://github.com/orgs/actions/people>`_ for
155+
creating the actions CI service that enables building and testing on all
156+
three major operating systems.
157+
+ `@animalize <https://github.com/animalize>`_ for explaining how to test and
158+
build python-isal for ARM 64-bit platforms.
159+
+ And last but not least: everyone who submitted a bug report or a feature
160+
request. These make the project better!
161+
162+
Python-isal would not have been possible without you!
163+
164+
.. acknowledgements end

docs/conf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,27 @@
3131
# Add any Sphinx extension module names here, as strings. They can be
3232
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3333
# ones.
34-
extensions = ["sphinx.ext.autodoc"
35-
]
34+
extensions = ["sphinx.ext.autodoc", 'sphinxarg.ext']
3635

3736
# Add any paths that contain templates here, relative to this directory.
3837
templates_path = ['_templates']
3938

4039
# List of patterns, relative to source directory, that match files and
4140
# directories to ignore when looking for source files.
4241
# This pattern also affects html_static_path and html_extra_path.
43-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
42+
# includes/* prevents double indexing
43+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'includes/*']
4444

4545

4646
# -- Options for HTML output -------------------------------------------------
4747

4848
# The theme to use for HTML and HTML Help pages. See the documentation for
4949
# a list of builtin themes.
5050
#
51-
html_theme = 'alabaster'
51+
html_theme = 'sphinx_rtd_theme'
52+
html_theme_options = dict(
53+
display_version=True,
54+
)
5255

5356
# Add any paths that contain custom static files (such as style sheets) here,
5457
# relative to this directory. They are copied after the builtin static files,

docs/includes/CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../CHANGELOG.rst

docs/includes/Installation.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
============
2+
Installation
3+
============
4+
Installation with pip
5+
---------------------
6+
7+
::
8+
9+
pip install isal
10+
11+
Installation is supported on Linux, MacOS and Windows. On most platforms
12+
wheels are provided.
13+
The installation will include a staticallly linked version of ISA-L.
14+
If a wheel is not provided for your system the
15+
installation will build ISA-L first in a temporary directory. Please check the
16+
`ISA-L homepage <https://github.com/intel/isa-l>`_ for the build requirements.
17+
18+
The latest development version of python-isal can be installed with::
19+
20+
pip install git+https://github.com/rhpvorderman/python-isal.git
21+
22+
This requires having the build requirements installed.
23+
If you wish to link
24+
dynamically against a version of libisal installed on your system use::
25+
26+
PYTHON_ISAL_LINK_DYNAMIC=true pip install isal --no-binary isal
27+
28+
ISA-L is available in numerous Linux distro's as well as on conda via the
29+
conda-forge channel. Checkout the `ports documentation
30+
<https://github.com/intel/isa-l/wiki/Ports--Repos>`_ on the ISA-L project wiki
31+
to find out how to install it. It is important that the development headers
32+
are also installed.
33+
34+
On Debian and Ubuntu the ISA-L libraries (including the development headers)
35+
can be installed with::
36+
37+
sudo apt install libisal-dev
38+
39+
Installation via conda
40+
----------------------
41+
Python-isal can be installed via conda, for example using
42+
the `miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ installer
43+
with a properly setup `conda-forge
44+
<https://conda-forge.org/docs/user/introduction.html#how-can-i-install-packages-from-conda-forge>`_
45+
channel. When used with bioinformatics tools setting up `bioconda
46+
<http://bioconda.github.io/user/install.html#install-conda>`_
47+
provides a clear set of installation instructions for conda.
48+
49+
python-isal is available on conda-forge and can be installed with::
50+
51+
conda install python-isal
52+
53+
This will automatically install the ISA-L library dependency as well, since
54+
it is available on conda-forge.

docs/includes/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.rst

docs/igzip.rst renamed to docs/includes/igzip.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
========================
12
API-documentation: igzip
23
========================
34

docs/includes/isal.igzip_usage.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
==========================
2+
python -m isal.igzip usage
3+
==========================
4+
5+
.. argparse::
6+
:module: isal.igzip
7+
:func: _argument_parser
8+
:prog: python -m isal.igzip

docs/isal_zlib.rst renamed to docs/includes/isal_zlib.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
============================
12
API Documentation: isal_zlib
23
============================
34

0 commit comments

Comments
 (0)