Download all crates on https://crates.io
Project description
CratesMirror
About
Download all crates on crates.io
Dependencies
Python >= 2.7.9
Installation
$ pip install cratesmirror
Usage
from cratesmirror import CratesMirror
indexdir = '/srv/git/index'
cratesdir = '/srv/www/crates'
config = {'dl': 'https://crates.mirrors.ustc.edu.cn/api/v1/crates',
'api': 'https://crates.io'}
# By default, it will be saved at os.getcwd()/crates.db
dbpath = '/var/lib/cratesmirror/crates.db'
with CratesMirror(indexdir, cratesdir, config=config, dbpath=dbpath) as mirror:
mirror.update_repo()
# with proxy
proxies = {
"http": "http://10.10.1.10:3128",
"https": "http://10.10.1.10:1080",
}
with CratesMirror(indexdir, cratesdir, config=config, proxy=proxies, dbpath=dbpath) as mirror:
mirror.update_repo()
Or use it in CLI
$ python -m cratesmirror -h
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cratesmirror-1.0.3.tar.gz
(7.6 kB
view hashes)