{"id":18259551,"url":"https://github.com/prospector-dev/requirements-detector","last_synced_at":"2025-12-12T01:02:07.985Z","repository":{"id":11290244,"uuid":"13702098","full_name":"prospector-dev/requirements-detector","owner":"prospector-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-07T09:06:20.000Z","size":240,"stargazers_count":49,"open_issues_count":2,"forks_count":20,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T10:12:19.639Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prospector-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-19T14:11:09.000Z","updated_at":"2025-01-07T09:06:24.000Z","dependencies_parsed_at":"2024-06-18T16:56:06.931Z","dependency_job_id":"fc425abd-dcda-42f2-abc7-b5505847f1b6","html_url":"https://github.com/prospector-dev/requirements-detector","commit_stats":{"total_commits":126,"total_committers":13,"mean_commits":9.692307692307692,"dds":0.2936507936507936,"last_synced_commit":"e611c7132847c0b49874d7fbfe8333bb8db3bbab"},"previous_names":["prospector-dev/requirements-detector","landscapeio/requirements-detector"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prospector-dev%2Frequirements-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prospector-dev%2Frequirements-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prospector-dev%2Frequirements-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prospector-dev%2Frequirements-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prospector-dev","download_url":"https://codeload.github.com/prospector-dev/requirements-detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036063,"owners_count":21037092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T10:38:39.765Z","updated_at":"2025-12-12T01:02:02.935Z","avatar_url":"https://github.com/prospector-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Requirements Detector\n\n## Status\n\n[![Latest Version](https://img.shields.io/pypi/v/requirements-detector.svg?label=version\u0026style=flat)](https://pypi.python.org/pypi/requirements-detector)\n[![Build Satus](https://github.com/landscapeio/requirements-detector/actions/workflows/ci.yaml/badge.svg)](https://github.com/landscapeio/requirements-detector/actions/workflows/ci.yaml)\n[![Health](https://landscape.io/github/landscapeio/requirements-detector/master/landscape.svg?style=flat)](https://landscape.io/github/landscapeio/requirements-detector/master)\n[![Coverage Status](https://img.shields.io/coveralls/landscapeio/requirements-detector.svg?style=flat)](https://coveralls.io/r/landscapeio/requirements-detector)\n[![Documentation](https://readthedocs.org/projects/requirements-detector/badge/?version=master)](https://readthedocs.org/projects/requirements-detector/)\n\n## About\n\n`requirements-detector` is a simple Python tool which attempts to find and list the requirements of a Python project.\n\nWhen 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.\n\nIt uses the following methods in order, in the root of the project:\n\n1. Parse `setup.py` (if this is successful, the remaining steps are skipped)\n2. Parse `pyproject.toml` (if a `tool.poetry.dependencies` section is found, the remaining steps are skipped)\n3. Parse `requirements.txt` or `requirements.pip`\n4. Parse all `*.txt` and `*.pip` files inside a folder called `requirements`\n5. 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`)\n\n### Usage\n\n```\ndetect-requirements [path]\n```\nIf `path` is not specified, the current working directory will be used.\n\n### Output\n\nThe output will be plaintext, and match that of a [pip requirements file](http://www.pip-installer.org/en/latest/logic.html), for example:\n\n```\nDjango==1.5.2\nSouth\u003e=0.8\nanyjson\ncelery\u003e=2.2,\u003c3\n```\n\n### Usage From Python\n\n```\n\u003e\u003e\u003e import os\n\u003e\u003e\u003e from requirements_detector import find_requirements\n\u003e\u003e\u003e find_requirements(os.getcwd())\n[DetectedRequirement:Django==1.5.2, DetectedRequirement:South\u003e=0.8, ...]\n```\n\n\nIf you know the relevant file or directory,  you can use `from_requirements_txt`, `from_setup_py` or `from_requirements_dir` directly.\n\n```\n\u003e\u003e\u003e from requirements_detector import from_requirements_txt\n\u003e\u003e\u003e from_requirements_txt(\"/path/to/requirements.txt\")\n[DetectedRequirement:Django==1.5.2, DetectedRequirement:South\u003e=0.8, ...]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprospector-dev%2Frequirements-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprospector-dev%2Frequirements-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprospector-dev%2Frequirements-detector/lists"}