Skip to main content

Manifest-driven Hugging Face upload/download CLI.

Project description

huggingfacesync (alias: hfsync)

Manifest-driven CLI for syncing files between a local folder and a Hugging Face Hub repo.

What it does

  • Upload files matched by manifest patterns.
  • Download files matched by manifest patterns.
  • Read default repo config from manifest (repo_id, repo_type).
  • Skip missing local patterns during upload.
  • Skip missing remote files during download.

Authentication

Login before syncing:

huggingface-cli login

Or set token in environment:

export HF_TOKEN=your_token

Install

python -m pip install --upgrade pip
python -m pip install "git+https://github.com/cplusx/hfsync.git"

Then run:

huggingfacesync --help
hfsync --help

Both command names are available and equivalent:

  • huggingfacesync
  • hfsync

If your shell cannot find these commands, use:

python -m upload_to_hf --help

Manifest format (.hfupload)

If .hfupload does not exist, huggingfacesync (or hfsync) will auto-create a template file and exit. If the file already exists, it is never overwritten.

# hfsync manifest
# repo_id=<your-namespace>/<your-repo>
# repo_type=dataset

# One glob per line
data/**
artifacts/**/*.json
metadata/*.csv

Config keys

  • repo_id: Hugging Face repo id, e.g. alice/my_dataset.
  • repo_type: one of dataset, model, space (default: dataset).

You can still override from CLI:

hfsync upload --repo-id alice/another_repo

Usage

# Upload matched local files
hfsync upload

# Download matched remote files
hfsync download

# Use custom manifest path
hfsync --manifest path/to/.hfupload upload
hfsync --manifest path/to/.hfupload download

# Preview only
hfsync upload --dry-run
hfsync download --dry-run

Large upload strategy

upload supports automatic switching to upload_large_folder:

# default: auto
hfsync upload

# force large-folder uploader
hfsync upload --large-upload always

# force regular uploader
hfsync upload --large-upload never

Auto mode switches to large uploader when either threshold is exceeded:

  • --large-files-threshold (default 3000)
  • --large-bytes-threshold (default 1000000000)

You can also set --large-num-workers for upload_large_folder.

Notes

  • Upload uses explicit matched files, so patterns that match nothing are reported and skipped.
  • Download first lists remote files then filters with manifest patterns.
  • Keep .hfupload under version control for reproducible sync behavior.

Release to PyPI

One-time setup

  1. Create a PyPI API token.
  2. In GitHub repo settings, add secret PYPI_API_TOKEN.

Publish a new version

# from repo root
./scripts/release.sh 0.1.3

This script will:

  • update versions in pyproject.toml and setup.py
  • build and run twine check
  • commit + create tag v<version> + push
  • trigger GitHub Actions publish workflow

The workflow file is at .github/workflows/publish.yml.

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

huggingfacesync-0.1.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

huggingfacesync-0.1.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file huggingfacesync-0.1.3.tar.gz.

File metadata

  • Download URL: huggingfacesync-0.1.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for huggingfacesync-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c7a5704a92e9450c95b8d8ba4b4e0133f1aa1ce70dc7b9e57e1d7b8e0697b17f
MD5 3ed9e502ad34be468cf9b3d75d827ea2
BLAKE2b-256 8e1bfd69250ef5481983a7252424ef5c3fe5266219555e25a9595d86cae3b36b

See more details on using hashes here.

File details

Details for the file huggingfacesync-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for huggingfacesync-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a6ad0ba745d444c495c69e49716f23802e031ee308a1d5fec55d962d69b5c954
MD5 866e5f81cf421b173f1619fbfb1589d8
BLAKE2b-256 ed7b48bba81c0769221046bc2126743151f897c6c6c5663fa4eb7a3b3403b910

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