Python tool to find and list requirements of a Python project
Project Links
Meta
Author: Landscape.io
Requires Python: >=3.10,<4.0
Classifiers
Development Status
- 5 - Production/Stable
Environment
- Console
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Operating System
- Unix
Programming Language
- Python :: 3
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
Topic
- Software Development :: Quality Assurance
Requirements Detector
Status
About
requirements-detector is a simple Python tool which attempts to find and list the requirements of a Python project.
When run from the root of a Python project, it will try to ascertain which libraries and the versions of those libraries that the project depends on.
It uses the following methods in order, in the root of the project:
- Parse
setup.py(if this is successful, the remaining steps are skipped) - Parse
pyproject.toml(if atool.poetry.dependenciessection is found, the remaining steps are skipped) - Parse
requirements.txtorrequirements.pip - Parse all
*.txtand*.pipfiles inside a folder calledrequirements - Parse all files in the root folder matching
*requirements*.txtorreqs.txt(so for example,pip_requirements.txtwould match, as wouldrequirements_common.txt)
Usage
detect-requirements [path]
If path is not specified, the current working directory will be used.
Output
The output will be plaintext, and match that of a pip requirements file, for example:
Django==1.5.2
South>=0.8
anyjson
celery>=2.2,<3
Usage From Python
>>> import os
>>> from requirements_detector import find_requirements
>>> find_requirements(os.getcwd())
[DetectedRequirement:Django==1.5.2, DetectedRequirement:South>=0.8, ...]
If you know the relevant file or directory, you can use from_requirements_txt, from_setup_py or from_requirements_dir directly.
>>> from requirements_detector import from_requirements_txt
>>> from_requirements_txt("/path/to/requirements.txt")
[DetectedRequirement:Django==1.5.2, DetectedRequirement:South>=0.8, ...]
1.5.0
Feb 03, 2026
1.4.0
Jun 11, 2025
1.3.2
Nov 08, 2024
1.3.1
Oct 04, 2024
1.3.0
Oct 04, 2024
1.2.2
May 20, 2023
1.2.1
Apr 20, 2023
1.2.0
Apr 20, 2023
1.1.0
Feb 16, 2023
1.0.3
Mar 21, 2022
1.0.2
Mar 21, 2022
1.0.1
Mar 21, 2022
1.0.0
Mar 21, 2022
0.7
May 29, 2020
0.6
Jul 22, 2018
0.5.2
Aug 19, 2016
0.5.1
May 15, 2016
0.4.1
Dec 01, 2015
0.4
Mar 24, 2015
0.3
Sep 27, 2014
0.2.3
Sep 22, 2014
0.2.2
May 02, 2014
0.2.1
Mar 07, 2014
0.2
Mar 05, 2014
0.1.3
Feb 01, 2014
0.1.2
Jan 26, 2014
0.1.1
Oct 26, 2013
0.1
Oct 19, 2013
Wheel compatibility matrix
Files in release
Extras:
None
Dependencies:
astroid
(<5.0,>=4.0)
packaging
(>=21.3)
semver
(<4.0.0,>=3.0.0)
tomli
(<3.0.0,>=2.2.1)