Skip to main content

pypi-mirror is a small script to generate a partial PyPI mirror. It relies on pip to do the most difficult part of the job (downloading a package and its dependencies).

Why?

Because most of the time you don’t need a full PyPI mirror but only a mirror that contains the packages you use. If you want a full PyPI mirror you should look at bandersnatch.

Installation

You can install pypi-mirror using pip:

pip install python-pypi-mirror

Or using conda:

conda install -c conda-forge python-pypi-mirror

How to use it?

The script provides several commands to manage your mirror. To find out which commands are available, type:

pypi-mirror --help

Every command provides its own help message. So for example to get the help message of the download command, type:

pypi-mirror download --help

The commands that you will probably use the most are the download command and the create command. For example to create a mirror which contains the requests package and its dependencies, you can type the following:

pypi-mirror download -d downloads requests
pypi-mirror create -d downloads -m simple

The first command will create a downloads directory into the current directory and use pip to download the requests package and its dependencies into the newly created directory. Then the create command will create a simple directory into the current directory and will build the mirror inside this newly created directory. You can add new packages by repeating this sequence of commands.

To make your mirror available through HTTP, you can point your HTTP server of choice to the simple directory. For exemple, type the following command into the current directory:

python3 -m http.server

It will start a HTTP server that will serve file from the current directory (which should contains the downloads directory and the simple directory). You can then install packages using your brand new mirror using the following command:

pip install -i http://127.0.0.1:8000/simple requests

About versioning

This package use semver to manage version numbering. It means that every times the major number is increased a backward incompatible change has been introduced in the API (the command line is an API). So be careful when upgrading to a new major release as it will surely break your scripts.

Release files for python-pypi-mirror 5.2.1

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

Source distribution (sdist)

Source distribution for python-pypi-mirror 5.2.1
File Size Uploaded
python-pypi-mirror-5.2.1.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-pypi-mirror 5.2.1
File Interpreter ABI Platform
python_pypi_mirror-5.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.2 kB

Release files / python-pypi-mirror-5.2.1.tar.gz

Download URL python-pypi-mirror-5.2.1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b47d11f17d7dfeb360cb8c161f5720cf6e7a8dea4fa55c3a2e8fbd6d8ba79f18
BLAKE2b-256 checksum
How to use checksums
3876d9076342f7a6b639d77dbbaeb8907c80a2b4fb69bb95920811ce020d7a12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / python_pypi_mirror-5.2.1-py3-none-any.whl

Download URL python_pypi_mirror-5.2.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7bf75d3738fdb48a2afa01f3bcac4ec53ee0d16e4a7be7a35cf3ca04ab3d24f
BLAKE2b-256 checksum
How to use checksums
2683cf6f5c9730e5bea6c6350105d5e9c9d41dff91aa571a17bca05228d0f122
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

5.2.1 This release

2 release files

5.2.0

2 release files

5.1.0

2 release files

5.0.2

2 release files

5.0.1

2 release files

5.0.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.7

2 release files

4.0.6

2 release files

4.0.5

2 release files

4.0.4

2 release files

4.0.3

2 release files

4.0.2

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.0.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.1

1 release file

1.0.0

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