Skip to main content

This application implements a PyPI mirror application according to PEP 381.

Installation

It is possible to run this application directly from the source distribution. Alternatively, ‘python setup.py install’ could be used.

The actual mirroring is performed by the pep381run script, which should be invoked through cron like this:

*/15 *  *   *   *     /path/pep381client/pep381run -q /var/pypi

The command line arguments points to root of the data files that the mirror creates. An initial run (without the -q option) should be performed manually. It is possible to interrupt the mirroring; it will automatically know where to continue when restarted.

In above example, /var/pypi/web must be served through the webserver. An Apache configuration could read like this:

<VirtualHost IPADDRESS:80>
  ServerName X.pypi.python.org
  CustomLog /var/log/apache2/pypi.log combined
  DocumentRoot /var/pypi/web
  SetEnv PYPITARGET /var/pypi
  ScriptAlias /sync /path/pep381sync.cgi
</VirtualHost>

Notice that supporting the sync URL requires that the web server user has access to the mirror data, or else that the CGI script runs as the mirror user.

To propagate the download statistics back to the central server, processlogs must be run regularly, e.g. through:

10 7  *   *   *     /path/pep381client/processlogs /var/pypi /var/log/apache2/pypi.log{,.1}

Contact

If you have questions or comments, please submit a bug report to http://bitbucket.org/loewis/pep381client/issues/new, or contact me at martin@v.loewis.de

Changes

1.5 (2011-05-09):

  • Fix mirroring bug that caused unnecessary deletion of files

  • Provide pep381checkfiles script to verify presence and integrity of all files

1.4 (2011-04-27):

  • Improve installation procedure (Jannis Leidel)

  • Add support for alternative storage backends (Jacob Kaplan-Moss)

  • Print nicer message for Ctrl-C (Jacob Kaplan-Moss)

  • Add –help option to pep381run (Horst Gutmann)

  • Drop mvindex again

  • Add support for master-initiated sync operations

  • Hotfix processing of empty project names

1.3 (2010-07-06):

  • The individual index pages where put into the wrong location; this is now fixed. Users should run ‘mvindex /var/pypi’ to fix their mirrors.

1.2 (2010-07-06):

  • Fix #1 for good.

1.1 (2010-07-05):

  • Issue #1: properly setup sqlite connection when initializing mirror.

1.0 (2010-07-05):

  • Initial release

Metadata

Release files for pep381client 1.5

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

Source distribution (sdist)

Source distribution for pep381client 1.5
File Size Uploaded Provenance
pep381client-1.5.tar.gz 9.4 kB Without provenance Details

Release files / pep381client-1.5.tar.gz

Download URL pep381client-1.5.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0da0c7d6e085d32411917a2eea1e51c5df8f35eeb89558531c3d5b22d4fcf49c
BLAKE2b-256 checksum
How to use checksums
d4d646dae326319cd32bafe0d1e5432c8d0e56baed252ce90cb8a6ff960f8810
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pep381client 1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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