How to download source distribution from pypi using pip?

Question:

I am creating a tool that analyzes a set of python package’s source distributions. I am wondering if it is possible to use pip (or any other module) to download the source distribution tarball without installing or building it. I am going to process a lot of source distributions making manually downloading them individually from pypi.org a very tedious solution. Essentially I want something like:

>pip download_sdist foo
Successfully downloaded foo-1.2.3.tar.gz
Asked By: finjasnappy

||

Answers:

Try this:

pip3 download --no-deps --no-binary :all: {MODULE_HERE}
Answered By: Marco Kurepa
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.