{"id":22316682,"url":"https://github.com/developerstoolbox/check-prerequisites-package","last_synced_at":"2025-12-13T15:02:26.588Z","repository":{"id":241124283,"uuid":"804351316","full_name":"DevelopersToolbox/check-prerequisites-package","owner":"DevelopersToolbox","description":"Check prerequisite are meet for commands that need to be run.","archived":false,"fork":false,"pushed_at":"2024-05-22T15:10:40.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-05-22T15:17:34.253Z","etag":null,"topics":["prerequisites","python","wolfsoftware"],"latest_commit_sha":null,"homepage":"","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/DevelopersToolbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["WolfSoftware","TGWolf"]}},"created_at":"2024-05-22T12:37:08.000Z","updated_at":"2024-05-22T15:17:36.912Z","dependencies_parsed_at":"2024-05-22T15:17:36.371Z","dependency_job_id":"e377aa28-0d95-49a3-bb74-c1e3f01c3f18","html_url":"https://github.com/DevelopersToolbox/check-prerequisites-package","commit_stats":null,"previous_names":["developerstoolbox/check-prerequisite-package"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fcheck-prerequisites-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fcheck-prerequisites-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fcheck-prerequisites-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fcheck-prerequisites-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevelopersToolbox","download_url":"https://codeload.github.com/DevelopersToolbox/check-prerequisites-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245581695,"owners_count":20639020,"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":["prerequisites","python","wolfsoftware"],"created_at":"2024-12-03T23:07:27.174Z","updated_at":"2025-12-13T15:02:26.274Z","avatar_url":"https://github.com/DevelopersToolbox.png","language":"Python","readme":"\u003c!-- markdownlint-disable --\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/\"\u003e\n        \u003cimg src=\"https://cdn.wolfsoftware.com/assets/images/github/organisations/developerstoolbox/black-and-white-circle-256.png\" alt=\"DevelopersToolbox logo\" /\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite/actions/workflows/cicd.yml\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/DevelopersToolbox/check-prerequisite/cicd.yml?branch=master\u0026label=build%20status\u0026style=for-the-badge\" alt=\"Github Build Status\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite/blob/master/LICENSE.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/DevelopersToolbox/check-prerequisite?color=blue\u0026label=License\u0026style=for-the-badge\" alt=\"License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/created-at/DevelopersToolbox/check-prerequisite?color=blue\u0026label=Created\u0026style=for-the-badge\" alt=\"Created\"\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/release/DevelopersToolbox/check-prerequisite?color=blue\u0026label=Latest%20Release\u0026style=for-the-badge\" alt=\"Release\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/release-date/DevelopersToolbox/check-prerequisite?color=blue\u0026label=Released\u0026style=for-the-badge\" alt=\"Released\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/commits-since/DevelopersToolbox/check-prerequisite/latest.svg?color=blue\u0026style=for-the-badge\" alt=\"Commits since release\"\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite/blob/master/.github/CODE_OF_CONDUCT.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite/blob/master/.github/CONTRIBUTING.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Contributing-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite/blob/master/.github/SECURITY.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/check-prerequisite/issues\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Overview\n\nWhen you write a script or tool which uses subprocess to execute shell commands, you want to know if the commands are installed or not. This is\nparticularly important if you are running multiple commands which rely on each other.\n\nYou can of course catch the exceptions through using `check=True` but if you need to know they all exist before you start your execution run then\nthis doesn't help you as it only handled the failure it currently has.\n\nThis little package assist with that problem by taking a list of commands that must be installed and available and verifies that list at the start to\nensure all of them are available.\n\n## Installation\n\n```shell\npip install wolfsoftware.prereqs\n```\n\n## Usage\n\n```python\nimport sys\n\nfrom wolfsoftware.prereqs import check_prerequisite, PrerequisiteCheckError\n\nprerequisites: list[str] = [\"python\", \"git\"]\n\ntry:\n    command_paths: dict = check_prerequisite(prerequisites)\nexcept PrerequisiteCheckError as err:\n    print(\"Prerequisite check failed:\")\n    for error in err.errors:\n        print(error)\n    sys.exit(0)\n\nprint(command_paths['python'])\n```\n\nOnce the checks have completed, you now have a dict of commands and their associated paths which you can then utilise to ensure you are executing\nyour subprocesses with the full path.\n\n\u003cbr /\u003e\n\u003cp align=\"right\"\u003e\u003ca href=\"https://wolfsoftware.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge\" /\u003e\u003c/a\u003e\u003c/p\u003e\n","funding_links":["https://github.com/sponsors/WolfSoftware","https://github.com/sponsors/TGWolf"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperstoolbox%2Fcheck-prerequisites-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloperstoolbox%2Fcheck-prerequisites-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperstoolbox%2Fcheck-prerequisites-package/lists"}