1

Is there a way to get Github URL from just the package name (package is not installed)? I want to get the URL somehow, using pip or some API which will give correct result and then clone the repo from that URL.

For ex, in NPM, we can get the url of the of where the source code is hosted using

npm view <package_name> repository.url
phd
  • 82,685
  • 13
  • 120
  • 165
  • Check this: https://stackoverflow.com/questions/16584552/how-to-state-in-requirements-txt-a-direct-github-source – Salman Ahmed May 12 '21 at 12:28
  • 1
    Your question makes the assumption that all packages in the PyPI are on github. – Klaus D. May 12 '21 at 12:28
  • 1
    PyPI has JSON API; see the docs at https://warehouse.readthedocs.io/api-reference/json.html . Examples: https://stackoverflow.com/search?q=%5Bpypi%5D+JSON+API . You can extract `url`, `download_url`, `package_url` or `project_urls` (most probably `project_urls['Homepage']`) from the package `info` or from `releases`. – phd May 12 '21 at 13:05

0 Answers0