A pure git Python library implemented in Rust using gitoxide. This library provides fast and memory-efficient git operations through Python bindings.
- Fast: Built with Rust and gitoxide for optimal performance
- Memory efficient: Leverages Rust's memory management
- Cross-platform: Works on Linux, macOS, and Windows
- Pure Python interface: Easy to use Python API
- Safe: Thread-safe operations with Rust's ownership model
Install from PyPI:
pip install gitpureimport gitpure
# Clone a repository (with worktree)
repo = gitpure.Repo.clone_from("https://github.com/user/repo.git", "/path/to/local/repo")
# Clone a bare repository
bare_repo = gitpure.Repo.clone_from("https://github.com/user/repo.git", "/path/to/bare/repo", bare=True)
# Get the git directory path
git_dir = repo.git_dir
print(f"Git directory: {git_dir}")- Python 3.8+
- Rust 1.70+
- maturin
# Clone the repository
git clone https://github.com/cmeister2/gitpure.git
cd gitpure
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install maturin
pip install maturin
# Build and install in development mode
maturin develop
# Or build wheel
maturin build --release# Install test dependencies
pip install pytest
# Run tests
pytest tests/Releases are fully automated with semantic-release. The pipeline will:
- Inspect the commit history on
mainusing Conventional Commits to determine the next semantic version. - Prepare the Rust crate, using the next version (or a dev version if available).
- Build wheels and source distributions with
maturinand attach them to the GitHub release. - Publish the distribution artifacts to PyPI.
To keep releases working you must:
- Continue to write commits that follow the Conventional Commits specification (
feat:,fix:, etc.).
You can trigger a release by merging changes into main.
gitpure is built on top of:
- gitoxide: A pure Rust implementation of git
- PyO3: Python bindings for Rust
- maturin: Build tool for Python extensions written in Rust
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for your changes
- Ensure all tests pass (
pytest) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.