Skip to main content

Requirements Detector

Status

Latest Version Build Satus Health Coverage Status Documentation

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:

  1. Parse setup.py (if this is successful, the remaining steps are skipped)
  2. Parse pyproject.toml (if a tool.poetry.dependencies section is found, the remaining steps are skipped)
  3. Parse requirements.txt or requirements.pip
  4. Parse all *.txt and *.pip files inside a folder called requirements
  5. Parse all files in the root folder matching *requirements*.txt or reqs.txt (so for example, pip_requirements.txt would match, as would requirements_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, ...]

Release files for requirements-detector 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for requirements-detector 1.6.0
File Size Uploaded
requirements_detector-1.6.0.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for requirements-detector 1.6.0
File Interpreter ABI Platform
requirements_detector-1.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.3 kB

Release files / requirements_detector-1.6.0.tar.gz

Download URL requirements_detector-1.6.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
601a57092f7a25fbbcf0985fbc91f2af64b1f882e951336cd4920ecee8fb03b1
BLAKE2b-256 checksum
How to use checksums
f6fa6f9194a51dd9d7dac6a01cad7ea1a99e8f2cf8c4badb84e7446c8f4509a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Release files / requirements_detector-1.6.0-py3-none-any.whl

Download URL requirements_detector-1.6.0-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f103d23f38a4c5d8f8858cb30c61c4ff1b0567e0315f8fe2b1595aa4e3ae0e8
BLAKE2b-256 checksum
How to use checksums
14db7ffd0113e60fd2ecd3918800a4e75567749ce5b5a2f31ecf20977bb5ab7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Release history Release notifications | RSS feed

This release

1.6.0 This release

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.7

1 release file

0.6

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.4.1

1 release file

0.4

1 release file

0.3

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page