A lightweight alternative to 'git clone' for installing Python packages directly from GitHub.
Project description
spclone
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
pipto 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.pypackages - PEP 518 - Modern
pyproject.tomlpackages - 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,ninjafor Meson-based packagesCythonfor packages with Cython extensionssetuptools,wheelfor 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-buildflag - Missing dependencies: Enable
--verboseto 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
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Run the test suite:
pytest - 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
pipandrequestslibraries - Thanks to the Python packaging community for modern build standards
๐ Support
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ง Contact: Create an issue for support questions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spclone-0.1.14.tar.gz.
File metadata
- Download URL: spclone-0.1.14.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4b65b1ecd644d9d1d5ca5197f63033774aedcc8e28912357218ce7511330526
|
|
| MD5 |
c284a84c1ff8ca8bb35c09a3289525b4
|
|
| BLAKE2b-256 |
8c2042349d3c8455cd5b8b367d87f24a6818e90f5535b0403e5edce2260e30d1
|
File details
Details for the file spclone-0.1.14-py3-none-any.whl.
File metadata
- Download URL: spclone-0.1.14-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db54cf08a0f25026e7dab0362aa14b3d0f94f698642c27e397697a1dc30d7823
|
|
| MD5 |
0d6265eda42454d4ea2e3960c3239f88
|
|
| BLAKE2b-256 |
91ce7de7cddcd2ace3823816fc4ef85c8ec310593e55fddb66b52ec0be241811
|