GithubHelp home page GithubHelp logo

rene-d / pypim Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 90 KB

PyPI mirroring

License: The Unlicense

Shell 1.33% Python 87.60% PLSQL 0.58% Go 7.41% Dockerfile 0.60% Makefile 2.48%
mirror mirroring pypi pypi-mirror-client pep381

pypim's Introduction

PyPIM

PyPI Intelligent Mirror

Introduction

There are many mirroring tools for PyPI.org. The well-known Bandersnatch works fine but cannot ensure dependencies.

That's why PyPIM has been written :

  • whitelist
  • blacklist
  • filter by platforms
  • retain only recent releases
  • respect the dependencies

But computing dependencies is time and space comsuming. The whole package metadata are required and easy to reach.

Using PyPIM

Usage: pypim.py [OPTIONS]

Options:
  -v, --verbose       verbose mode
  -nv, --non-verbose  no so much verbose
  -n, --dry-run       dry run
  -u, --update        update list of packages
  -m, --metadata      download JSON metadata
  -p, --packages      mirror packages
  -a, --add TEXT      package name
  -h, --help          Show this message and exit.

Fetch the list of packages

./pypim.py -u

The script uses the XML-RPC API to fetch the list of packages and their last_serial (a growing-only internal counter).

Download the package metadata

Based on the previous list of packages, the script uses the [JSON API](

./pypim.py -m

The script uses the XML-RPC API to download the package metadata.

The response, in JSON, is made of 4 sections:

  • info : package description
  • last_serial : a number
  • releases : list of releases
  • urls: files of the current releases

The metadata is stored in both raw and decoded formats, in two SQLite3 databases.

Download the packages

./pypim.py -p [-a name1] [-a name2[==version]]...

Exclude packages

Filter by platforms

Keep only recents releases

Respect the dependencies

Add a whitelist

Examples

Sync the test index

./pypim.py -v --db test.db --test -um

Sync the whole index with our package requirements

./pypim.py -lf mirror.log -ump -a pyxb==1.2.3 -r <(pip3 freeze) --web /data/mirrors/pypi

Some reference links

pypim's People

Contributors

rene-d avatar

Stargazers

 avatar

Watchers

 avatar

pypim's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.