Skip to main content

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
  • Support for HTTPS, SSH, and GitLab-style shorthand (group/repo → full URL)

Features

  • Git provider:
    • Shallow clone (--depth 1, --no-tags)
    • Branch/tag selection via --branch/-b

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 and checkout to a specific branch
artifetch https://gitlab.com/org/monorepo.git -d ./repos -p git -b release/1.0 

Options:

  • source: Git URL or shorthand
  • --dest, -d: Destination folder (default: .)
  • --branch, -b: Branch or tag
  • --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")

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
p = f.fetch("https://gitlab.com/org/monorepo.git", dest)

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

  • Destination rules:
    • Full repo → dest/<repo_name>

Troubleshooting

  • git not found: Install Git or set GIT_BINARY.
  • Destination exists: Remove or rename before retry.

Roadmap

  • GitLab artifacts
  • Artifactory downloads
  • Repository Content

License

MIT

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

artifetch-0.0.7.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

artifetch-0.0.7-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file artifetch-0.0.7.tar.gz.

File metadata

  • Download URL: artifetch-0.0.7.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for artifetch-0.0.7.tar.gz
Algorithm Hash digest
SHA256 9cddf1d3353484c08eaec6599a107a4ce9aae0206595e7ded76692c038e0982e
MD5 dc0aa651da72c42bbad423c84fb939a8
BLAKE2b-256 931c1765a9e690ec658ab3544ed38168ece73f74e59ebce0d65ea424019aae1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for artifetch-0.0.7.tar.gz:

Publisher: publish.yml on gemmamary/artifetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file artifetch-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: artifetch-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for artifetch-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fcc839142643f1859bb1dcfa2e03c26a4724f0b5376ce8d262c3aacf7d5d2079
MD5 2862ef64a0052648f7ef67f7868019e4
BLAKE2b-256 2d474982c0a4c7253ef2cf3c991f03a66541fadf21919b5714988ba5eb068a5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for artifetch-0.0.7-py3-none-any.whl:

Publisher: publish.yml on gemmamary/artifetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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