Universal artifact fetcher for Artifactory, GitLab, and Git.
Project description
Artifetch
Artifetch is a universal artifact fetcher. In v1, it focuses on Git repositories with:
- Fast shallow clones by default
- Optional branch/tag checkout
- Sparse checkout of a subdirectory, materialized directly under your destination folder
- Support for HTTPS, SSH, and GitLab-style shorthand (
group/repo→ full URL) - Safe cleanup on Windows
Features
- Git provider:
- Shallow clone (
--depth 1,--no-tags) - Branch/tag selection via
--branch/-b - Sparse checkout for a single subdirectory
- Credential redaction in error messages
- Shallow clone (
Installation
From PyPI:
pip install artifetch
From source:
pip install -e .
CLI Usage
# Clone default branch into ./repos/monorepo
artifetch https://gitlab.com/org/monorepo.git -d ./repos -p git
# Clone a specific branch
artifetch https://gitlab.com/org/monorepo.git -d ./repos -p git -b release/1.0
# Materialize only a subdirectory directly under dest
artifetch group/monorepo -d ./workspace -p git -s modules/adas/camera
# SSH URL with subdir
artifetch git@gitlab.com:org/monorepo.git -d ./workspace -p git -s modules/vision/perception
# Subdirectory from a specific branch
artifetch group/monorepo -d ./workspace -p git -b release/1.0 -s modules/adas/camera
Options:
source: Git URL or shorthand--dest, -d: Destination folder (default:.)--branch, -b: Branch or tag--subdir, -s: Subdirectory to materialize--verbose, -v: Enable debug logs
Python API
High-level helper
from pathlib import Path
from artifetch.core import fetch
dest = Path("./workspace")
# Full repo
path = fetch("https://gitlab.com/org/monorepo.git", dest=dest)
print(path) # ./workspace/monorepo
# Branch
path = fetch("https://gitlab.com/org/monorepo.git", dest=dest, branch="release/1.0")
# Subdirectory only
path = fetch("group/monorepo", dest=dest, subdir="modules/adas/camera")
print(path) # ./workspace/modules/adas/camera
Direct Git provider
from pathlib import Path
from artifetch.providers.git import GitFetcher
f = GitFetcher()
dest = Path("./workspace")
# SSH URL
p = f.fetch("git@gitlab.com:org/monorepo.git", dest, branch="main")
# HTTPS + subdir
p = f.fetch("https://gitlab.com/org/monorepo.git", dest, subdir="modules/vision/perception")
Environment Variables
| Variable | Purpose | Default |
|---|---|---|
| GIT_BINARY | Path to git executable | auto-detect |
| ARTIFETCH_GIT_HOST | Host for shorthand normalization | gitlab.com |
| ARTIFETCH_GIT_PROTO | ssh or https for shorthand | ssh |
| ARTIFETCH_GIT_USER | SSH user for shorthand | git |
Example:
shell:
export ARTIFETCH_GIT_PROTO=https
export ARTIFETCH_GIT_HOST=git.mycorp.local
or .env file
ARTIFETCH_GIT_PROTO=https
ARTIFETCH_GIT_HOST=git.mycorp.local
Behavior Details
- Subdir normalization: Converts backslashes to
/, collapses//, trims leading/trailing slashes. - Destination rules:
- Full repo →
dest/<repo_name> - Subdir →
dest/<normalized_subdir>
- Full repo →
- Cleanup: Repo folder is deleted after moving subdir (Windows-safe retry logic).
Troubleshooting
- Access denied on Windows: Artifetch retries deletion with backoff and clears read-only bits.
- git not found: Install Git or set
GIT_BINARY. - Destination exists: Remove or rename before retry.
Roadmap
- GitLab artifacts
- Artifactory support
License
MIT
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 artifetch-0.0.6.tar.gz.
File metadata
- Download URL: artifetch-0.0.6.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ca587be29e43a63ababfa10dcaad4d4481a864b1dcef48d3fd9776f948ae40a
|
|
| MD5 |
984bb24caccef55f11cc9a19b24accfe
|
|
| BLAKE2b-256 |
e4e011635bf1012a4dae7e23cda5f7f99fb857808ff7af360d66b8730cf5d17d
|
Provenance
The following attestation bundles were made for artifetch-0.0.6.tar.gz:
Publisher:
publish.yml on gemmamary/artifetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
artifetch-0.0.6.tar.gz -
Subject digest:
5ca587be29e43a63ababfa10dcaad4d4481a864b1dcef48d3fd9776f948ae40a - Sigstore transparency entry: 635451192
- Sigstore integration time:
-
Permalink:
gemmamary/artifetch@3b3f1faa3f7220bdb3ec7c1787a19538663aa7d6 -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/gemmamary
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3b3f1faa3f7220bdb3ec7c1787a19538663aa7d6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file artifetch-0.0.6-py3-none-any.whl.
File metadata
- Download URL: artifetch-0.0.6-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e53089e2cf88e09de74e65d8db3067555ffe493594a505af795ef1df74418f79
|
|
| MD5 |
22d31e7a08e61e9f9b208e9d48f600fc
|
|
| BLAKE2b-256 |
5a9333e7e5792fa8a04fbb491734b59fc5680bfba3a5d55b7f2eb722a6a89464
|
Provenance
The following attestation bundles were made for artifetch-0.0.6-py3-none-any.whl:
Publisher:
publish.yml on gemmamary/artifetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
artifetch-0.0.6-py3-none-any.whl -
Subject digest:
e53089e2cf88e09de74e65d8db3067555ffe493594a505af795ef1df74418f79 - Sigstore transparency entry: 635451230
- Sigstore integration time:
-
Permalink:
gemmamary/artifetch@3b3f1faa3f7220bdb3ec7c1787a19538663aa7d6 -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/gemmamary
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3b3f1faa3f7220bdb3ec7c1787a19538663aa7d6 -
Trigger Event:
push
-
Statement type: