Skip to main content

A lightweight alternative to 'git clone' for installing Python packages directly from GitHub.

Project description

spclone

Python package PyPI PyPI Downloads Status License Python

A lightweight CLI tool that lets you install and clone Python packages directly from GitHub โ€” no need to manually git clone and install.

๐Ÿš€ Features

  • ๐Ÿ“ฆ Direct Installation: Install packages directly from GitHub URLs or shorthand (user/repo)
  • ๐Ÿ”ง Modern Build Support: Handles complex build systems (Meson, setuptools, wheel)
  • ๐Ÿ Environment Integration: Automatically uses pip to install in your current environment
  • ๐Ÿงผ Clean Workflow: No cluttered filesystem with temporary clone directories
  • โšก Fast & Lightweight: Focused on Python package management
  • ๐ŸŒฟ Branch Support: Install from specific branches or tags

๐Ÿ“ฆ Installation

pip install spclone

๐Ÿ› ๏ธ Usage

Package Installation (spinstall)

Install Python packages directly from GitHub:

# Install from owner/repo format
spinstall pandas-dev/pandas
spinstall microsoft/pylance

# Install from full URLs
spinstall https://github.com/psf/requests
spinstall https://github.com/django/django

# Install from specific branch
spinstall pandas-dev/pandas --branch main
spinstall scikit-learn/scikit-learn -b develop

# Verbose output for debugging
spinstall numpy/numpy --verbose

# Force build from source (for complex packages)
spinstall pandas-dev/pandas --force-build

Repository Cloning (spclone)

Clone repositories for development:

# Clone to default directory (owner-repo)
spclone pandas-dev/pandas
spclone https://github.com/psf/requests

# Clone to specific directory
spclone django/django --directory my-django-fork
spclone microsoft/vscode -d vscode-dev

# Clone specific branch
spclone pytorch/pytorch --branch nightly
spclone tensorflow/tensorflow -b r2.13

# Verbose output
spclone fastapi/fastapi --verbose

Advanced Examples

# Install bleeding-edge pandas with verbose output
spinstall pandas-dev/pandas --branch main --verbose --force-build

# Clone multiple repositories
spclone numpy/numpy -d numpy-dev
spclone scipy/scipy -d scipy-dev
spclone matplotlib/matplotlib -d matplotlib-dev

# Install from .git URLs (automatically handled)
spinstall https://github.com/psf/requests.git

๐Ÿ—๏ธ Build System Support

spclone automatically detects and handles various Python build systems:

  • setuptools - Traditional setup.py packages
  • PEP 518 - Modern pyproject.toml packages
  • Meson - Complex packages like pandas, numpy
  • Cython - Packages with compiled extensions
  • Wheel - Binary distributions

For complex packages (pandas, numpy, scipy), build dependencies are automatically installed:

  • meson-python, meson, ninja for Meson-based packages
  • Cython for packages with Cython extensions
  • setuptools, wheel for standard packages

๐Ÿ“‹ Command Reference

spinstall - Install Packages

Option Short Description
--verbose -v Enable verbose output
--branch -b Specify branch/tag to install from
--force-build Force building from source
--version Show version information

spclone - Clone Repositories

Option Short Description
--verbose -v Enable verbose output
--branch -b Specify branch/tag to clone
--directory -d Target directory name
--version Show version information

๐Ÿ” Input Formats

All commands accept flexible input formats:

# All of these work:
spinstall psf/requests
spinstall https://github.com/psf/requests
spinstall github.com/psf/requests
spinstall psf/requests.git

๐Ÿ’ก Use Cases

  • Development: Quickly install development versions of packages
  • Testing: Test against latest upstream changes
  • Contributing: Install your fork for development
  • CI/CD: Install specific versions in automated workflows
  • Research: Use cutting-edge features not yet released

๐Ÿ› Troubleshooting

Installation Issues

# For complex packages, try force-build mode
spinstall pandas-dev/pandas --force-build --verbose

# Check if build dependencies are installed
pip list | grep -E "(meson|ninja|cython)"

Common Solutions

  • Build failures: Use --force-build flag
  • Missing dependencies: Enable --verbose to see detailed error messages
  • Network issues: Check your internet connection and GitHub access
  • Permission errors: Ensure you have write access to your Python environment

๐Ÿ—๏ธ Development

Setup Development Environment

# Clone the repository
git clone https://github.com/SermetPekin/spclone.git
cd spclone

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Run tests with coverage
pytest --cov=spclone --cov-report=html

Project Structure

spclone/
โ”œโ”€โ”€ spclone/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ cli.py          # Command-line interface
โ”‚   โ””โ”€โ”€ clone_.py       # Core functionality
โ”œโ”€โ”€ tests/              # Test suite
โ”œโ”€โ”€ pyproject.toml      # Project configuration
โ””โ”€โ”€ README.md

๐ŸชŸ Windows Users

Build Tools Required

Some Python packages (pandas, numpy, scipy, etc.) require C++ compilation on Windows. If you get errors about vswhere.exe or "Microsoft Visual C++ 14.0 is required":

# Check if build tools are available
spinstall --check-build-tools

# Get installation instructions
spinstall --install-build-help

Quick Fix

Option 1: Install Visual Studio Build Tools (Recommended)

  1. Download Build Tools for Visual Studio
  2. Install with "C++ build tools" workload
  3. Include "Windows 10/11 SDK"
  4. Restart your terminal

Option 2: Try pre-compiled packages first

# Install from PyPI first (if available), then try development version
pip install pandas  # Get stable version first
spinstall pandas-dev/pandas  # Then try development version

Common Issues

  • Long paths: Windows has path length limits - temp directories use short names
  • File permissions: Admin privileges may be needed for some installations
  • Antivirus software: May interfere with compilation - add Python folder to exclusions

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Run the test suite: pytest
  5. Submit a pull request

๐Ÿ“ License

This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Inspired by the need for simpler Python package installation workflows
  • Built on top of Python's excellent pip and requests libraries
  • Thanks to the Python packaging community for modern build standards

๐Ÿ“ž Support


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

spclone-0.1.15.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

spclone-0.1.15-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file spclone-0.1.15.tar.gz.

File metadata

  • Download URL: spclone-0.1.15.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for spclone-0.1.15.tar.gz
Algorithm Hash digest
SHA256 a5a164aabc8c776e3cae8e59c0e1f0f1480d48723025f8dc0e7e3150d3cb3314
MD5 f5a0876ce3b3530d063104f4c46fb910
BLAKE2b-256 e892914706fb7511f1ebcf9df250afccc7ac2e5ad01fc37c25bff138e3f8b5f0

See more details on using hashes here.

File details

Details for the file spclone-0.1.15-py3-none-any.whl.

File metadata

  • Download URL: spclone-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for spclone-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 2c01637e6fde54ab4f2689154a526274b4971cbb21bdb4fa4769ca205bde7f5f
MD5 faf0ebf726f2ff18ca5c92765c103133
BLAKE2b-256 8a71bfddd834fce08b433c655432d059378ecf546edd0d168c2e97fce5fa7feb

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