| 1 |
.. # Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 |
# you may not use this file except in compliance with the License. |
| 3 |
# You may obtain a copy of the License at |
| 4 |
# |
| 5 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 |
# |
| 7 |
# Unless required by applicable law or agreed to in writing, software |
| 8 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 9 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 |
# See the License for the specific language governing permissions and |
| 11 |
# limitations under the License. |
| 12 |
# |
| 13 |
# SPDX-License-Identifier: Apache-2.0 |
| 14 |
|
| 15 |
Welcome to Requirements Parser's documentation! |
| 16 |
=============================================== |
| 17 |
|
| 18 |
Requirements parser is a Python module for parsing Pip_ requirement files. |
| 19 |
|
| 20 |
.. _Pip: http://www.pip-installer.org |
| 21 |
|
| 22 |
Requirements parser is (now) `Apache 2.0`_ licensed. |
| 23 |
|
| 24 |
.. _Apache 2.0: https://www.apache.org/licenses/LICENSE-2.0 |
| 25 |
|
| 26 |
Quickstart: |
| 27 |
|
| 28 |
.. code-block:: python |
| 29 |
|
| 30 |
import requirements |
| 31 |
|
| 32 |
reqfile = """ |
| 33 |
Django>=1.5,<1.6 |
| 34 |
DocParser[PDF]==1.0.0 |
| 35 |
""" |
| 36 |
|
| 37 |
for req in requirements.parse(reqfile): |
| 38 |
print(req.name, req.specs, req.extras) |
| 39 |
|
| 40 |
Will output: |
| 41 |
|
| 42 |
:: |
| 43 |
|
| 44 |
Django [('>=', '1.5'), ('<', '1.6')] [] |
| 45 |
DocParser [('==', '1.0.0')] ['pdf'] |
| 46 |
|
| 47 |
Contents: |
| 48 |
|
| 49 |
.. toctree:: |
| 50 |
:maxdepth: 2 |
| 51 |
|
| 52 |
usage |
| 53 |
changelog |
| 54 |
lowlevel |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
Indices and tables |
| 59 |
================== |
| 60 |
|
| 61 |
* :ref:`genindex` |
| 62 |
* :ref:`modindex` |
| 63 |
* :ref:`search` |
| 64 |
|