python-pip-requirements-parser
Port variant v15
Summary Decent pip requirements parsing library (3.15)
Package version 32.0.1
Homepage https://github.com/nexB/pip-requirements-parser
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v14
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 27 NOV 2026, 01:15:48 UTC
Port created 27 NOV 2026, 01:15:48 UTC
Subpackage Descriptions
single pip-requirements-parser - a mostly correct pip requirements parsing library ================================================================================ Copyright (c) nexB Inc. and others. Copyright (c) The pip developers (see AUTHORS.rst file) SPDX-License-Identifier: MIT Homepage: https://github.com/nexB/pip-requirements and https://www.aboutcode.org/ ``pip-requirements-parser`` is a mostly correct pip requirements parsing library ... because it uses pip's own code! pip is the package installer for Python that is using "requirements" text files listing the packages to install. Per https://pip.pypa.io/en/stable/reference/requirements-file-format/ : "The requirements file format is closely tied to a number of internal details of pip (e.g., pip’s command line options). The basic format is relatively stable and portable but the full syntax, as described here, is only intended for consumption by pip, and other tools should take that into account before using it for their own purposes." And per https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program : "[..] pip is a command line program. While it is implemented in Python, and so is available from your Python code via import pip, you must not use pip’s internal APIs in this way." "What this means in practice is that everything inside of pip is considered an implementation detail. Even the fact that the import name is pip is subject to change without notice. While we do try not to break things as much as possible, all the internal APIs can change at any time, for any reason. It also means that we generally won’t fix issues that are a result of using pip in an unsupported way." Because of all this, pip requirements are notoriously difficult to parse right in all their diversity because: - pip does not have a public API and therefore cannot be reliably used as a stable library. Some libraries attempt to do this though. (See Alternative) - The pip requirements file syntax is closely aligned with pip's command line interface and command line options. In some ways a pip requirements file is a list of pip command line options and arguments. Therefore, it is hard to parse these short of reproducing the pip command line options parsing. At least one other library is using a command line option parser to parse options correctly. This ``pip-requirements-parser`` Python library is yet another pip requirements files parser, but this time doing it hopefully correctly and doing as well as pip does it, because this is using pip's own code. The ``pip-requirements-parser`` library offers these key advantages: - Other requirements parsers typically do not work in all the cases that pip supports: parsing any requirement as seen in the wild will fail parsing some valid pip requirements. Since the ``pip-requirements-parser`` library is based on pip's own code, it works **exactly** like pip and will parse all the requirements files that pip can parse. - The ``pip-requirements-parser`` library offers a simple and stable code API that will not change without notice. - The ``pip-requirements-parser`` library is designed to work offline without making any external network call, while the original pip code needs network access. - The ``pip-requirements-parser`` library is a single file that can easily be copied around as needed for easy vendoring. This is useful as requirements parsing is often needed to bootstrap in a constrained environment. - The ``pip-requirements-parser`` library has only one external dependency on the common "packaging" package. Otherwise it uses only the standard library. The benefits are the same as being a single file: fewer moving parts
Configuration Switches (platform-specific settings discarded)
PY314 OFF Build using Python 3.14 PY315 ON Build using Python 3.15
Package Dependencies by Type
Build (only) python315:dev:std
python-pip:single:v15
autoselect-python:single:std
Build and Runtime python315:primary:std
Runtime (only) python-packaging:single:v15
python-pyparsing:single:v15
Download groups
main mirror://PYPIWHL/54/d0/d04f1d1e064ac901439699ee097f58688caadea42498ec9c4b4ad2ef84ab
Distribution File Information
4659bc2a667783e7a15d190f6fccf8b2486685b6dba4c19c3876314769c57526 35648 python-src/pip_requirements_parser-32.0.1-py3-none-any.whl
Ports that require python-pip-requirements-parser:v15
python-cyclonedx-bom:v15 Software Bill of Materials generator (3.15)