skillfed

requirements-parser

This is a small Python module for parsing Pip requirement files.

requirements-parser v0.13.1 17.8M downloads/30d#1,103 on PyPI141
Permissive license Apache-2.0 Active released

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-parser

uv

uv add requirements-parser

poetry

poetry add requirements-parser

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Software DistributionTyping :: Typed

Tags

parse pip requirements filesrequirement file parserextract package dependenciespip requirements parsingparse requirements.txtdependency specification parserpip format parser
dependency-parsingpip-tools

More Software Development packages