Skip to main content

Resumable Package Installer - a wrapper around pip for robust downloads

Project description

Resumable PIP

A Command-Line Interface (CLI) tool that wraps pip to provide resumable downloads for Python packages, especially useful for large packages (like PyTorch or TensorFlow) on flaky internet connections.

Features

  • Resumable Downloads: Automatically resume interrupted downloads
  • Platform Independent: Works on Windows, macOS, and Linux without external dependencies
  • Multiple Downloaders: Supports aria2c, wget, curl, or native Python (automatic fallback)
  • File Integrity: SHA256/SHA512 hash verification for downloaded packages
  • Progress Tracking: Real-time download progress with speed and size information
  • Robust Error Handling: Informative error messages with recovery instructions

Installation

pipx install syblock-rpip
# OR
pip install syblock-rpip

Prerequisites

No external dependencies required! The tool includes a native Python downloader with full resume support.

For better performance, you can optionally install:

  • aria2c (recommended for best performance and speed)
  • wget
  • curl

If none are available, rpip automatically uses the built-in Python downloader.

Usage

# Single package installation
rpip package-name

# With version specifier
rpip "package-name==1.2.3"

# With pip options
rpip package-name --user

# Install from requirements file
rpip -r requirements.txt
rpip --requirement requirements.txt

# Auto-detect requirements file
rpip requirements.txt

# Examples
rpip torch
rpip "tensorflow>=2.0"
rpip numpy --upgrade
rpip -r requirements.txt --user

How It Works

Single Package

  1. Uses pip's resolution engine to find the correct package URL
  2. Selects the best available downloader (aria2c > wget > curl > native Python)
  3. Downloads the package file with full resume support via HTTP Range requests
  4. Verifies file integrity using SHA256/SHA512 hash (if available)
  5. Installs the package using pip
  6. Cleans up the downloaded file on success

Requirements File

  1. Parses the requirements file (supports comments, nested -r, and most pip syntax)
  2. Installs each package sequentially with full resumable download support
  3. Tracks successful and failed installations
  4. Provides a detailed summary at the end

Download Methods

The tool automatically selects the best available downloader:

  1. aria2c - Multi-connection downloads, fastest performance
  2. wget - Reliable, widely available on Linux/macOS
  3. curl - Built-in on most systems
  4. Python urllib - Native fallback, works everywhere, includes progress bar

Requirements File Support

rpip supports standard requirements.txt syntax including:

  • ✅ Package names with version specifiers (package==1.0.0, package>=2.0)
  • ✅ Comments (lines starting with # or inline with #)
  • ✅ Nested requirements files (-r other-requirements.txt)
  • ✅ Blank lines
  • Editable installs (-e ., -e git+https://...#egg=package)
  • Pip options (--index-url, --extra-index-url, --trusted-host, etc.)

Editable Installs

Editable installs are fully supported! These are installed directly via pip (no download/resume needed since git has its own resume capability):

# In requirements.txt:
-e .
-e /path/to/local/package
-e git+https://github.com/user/repo.git#egg=package
--editable git+https://github.com/user/repo.git@branch#egg=package

When rpip encounters an editable install, it passes it directly to pip for installation.

Pip Options

Important pip options are fully supported and applied to all package installations:

# In requirements.txt:
--index-url https://my-private-pypi.org/simple
--extra-index-url https://pypi.org/simple
--trusted-host my-private-pypi.org
--find-links https://download.pytorch.org/whl/torch_stable.html

requests==2.28.0
numpy>=1.20.0

Supported options:

  • --index-url - Custom PyPI server
  • --extra-index-url - Additional package indexes
  • --trusted-host - Allow HTTP (non-HTTPS) hosts
  • --find-links - Additional package sources
  • --no-index, --prefer-binary, --pre, --no-binary, --only-binary

These options are extracted from the requirements file and applied to ALL package installations in that file.

Limitations

  • Packages are installed sequentially (not in parallel) to ensure resumability

Development

Running Tests

Install with test dependencies:

pip install -e ".[test]"
# or with all dev dependencies
pip install -e ".[dev]"

Run the test suite:

# Run all tests
pytest

# Run with coverage
pytest --cov=. --cov-report=html

Test Coverage

The project includes comprehensive unit and integration tests (40 tests):

  • Unit tests - Test individual functions in isolation
  • Integration tests - Test complete workflows
  • Download tests - Test actual package downloads from PyPI (disabled by default)
  • Editable install tests - Test -e and --editable support
  • Fixtures - Sample requirements files for testing

See tests/README.md for detailed testing documentation.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new features
  4. Ensure all tests pass
  5. Submit a pull request

License

MIT License

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

syblock_rpip-0.1.4.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syblock_rpip-0.1.4-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file syblock_rpip-0.1.4.tar.gz.

File metadata

  • Download URL: syblock_rpip-0.1.4.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for syblock_rpip-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f13ade9756c89350576ae200e83f02452531eb308c91f2eaefba967b5f5404ce
MD5 1be0b74aab33f184d7097d647ecc80a1
BLAKE2b-256 bb29f66c8926e431b4dbb3f759746d1fb5cff2977d7553681f29cacc0c19868e

See more details on using hashes here.

File details

Details for the file syblock_rpip-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: syblock_rpip-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for syblock_rpip-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9af3e8803e1c6ba0563d7e95d4647331c5edf86ba871c03e57854487e45deb02
MD5 0f91dc9f6bd2059a6b99d63eb8ad17a7
BLAKE2b-256 e64bbf98a9cc02b97be765f01ba176a459dff66bab817f20e63415c6046ae463

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page