requirements-parser
This is a small Python module for parsing Pip requirement files.
What it is and what it does
requirements-parser is a lightweight Python module that reads and parses pip requirement files—the text files that list project dependencies—into structured objects you can inspect programmatically. It accepts either a file-like object or a string and extracts package names, version constraints, and metadata like extras, URLs, and version control references.
The module handles most pip requirement file syntax including editables, version control URIs, egg hashes, subdirectories, and extras. It has a single runtime dependency on packaging and supports Python 3.8 through 3.14. The project is actively maintained and has been in use since its initial release in 2013.
Use it for:
- Programmatically inspect and validate requirements.txt files in build or deployment scripts
- Extract dependency metadata for dependency analysis or auditing tools
- Parse requirements files to generate reports or migrate dependencies between formats
- Validate requirement syntax before installation in CI/CD pipelines
- Build tools that need to understand pip dependency specifications
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses pip requirement files into structured data, extracting package names, version specifiers, and metadata like extras, URLs, and version control references.
Yes. This is a stable, actively maintained parser with low install friction and no known vulnerabilities. Use it when you need to programmatically read and inspect pip requirement files rather than parsing them manually or with regex.
Install
requirements-parser on PyPI
pip
pip install requirements-parseruv
uv add requirements-parserpoetry
poetry add requirements-parserInstalling requirements-parser
Before you install
Low friction install with a single runtime dependency (packaging). Actively maintained with a recent release; repository is not archived and has received commits within the last two months.
License in practice
Licensed under Apache 2.0 (permissive), allowing modification and redistribution with minimal restrictions—suitable for both open-source and commercial use.
Quickstart
pip install requirements-parser
import requirements
with open('requirements.txt', 'r') as fd:
for req in requirements.parse(fd):
print(req.name, req.specs)
Verify before relying
- Whether the parser handles all edge cases in the current pip requirement file format specification
- Performance characteristics when parsing very large requirement files
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — packaging |
| Maintenance | actively maintained — 57 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 17,822,865/month — #1,103 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: requirements_parser-0.13.1-py3-none-any.whl
Keywords: Pip, requirements, parse
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
pip-requirements-parserParses pip requirements files with the same…
permissive · top 1,000 on PyPI
hatch-requirements-txtA Hatchling plugin that reads project…
permissive · top 5,000 on PyPI
requirementslibParses, builds, and converts between Pipfile…
permissive · top 15,000 on PyPI
poetry-plugin-exportExports Poetry's locked dependency tree to…
permissive · top 1,000 on PyPI
hashinAutomates the process of adding cryptographic…
permissive · top 15,000 on PyPI
git-url-parseParses Git repository URLs to extract…
permissive · top 15,000 on PyPI
pip-apiProvides an importable Python API that wraps…
permissive · top 1,000 on PyPI
cyclonedx-pyGenerates Software Bill of Materials (SBOM)…
unclear · top 15,000 on PyPI
tls-parserParses TLS records from binary data, extracting…
unclear · top 15,000 on PyPI
cyclonedx-bomGenerates Software Bill of Materials (SBOM)…
permissive · top 5,000 on PyPI