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"

Runtime dependency huggingface_hub is installed automatically by pip.

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.

For project maintainers, release instructions are in MAINTAINING.md.

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.4.tar.gz (5.2 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.4-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: huggingfacesync-0.1.4.tar.gz
  • Upload date:
  • Size: 5.2 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.4.tar.gz
Algorithm Hash digest
SHA256 3afabb87b2f0199254211820889cb0163de2d82396038fdb1c1a0f11aa7d147a
MD5 f7a148837acb97a2101b96db4e9ccbcb
BLAKE2b-256 052c24ada7b665c1177fdcc377141843693e5ac8b218f37e6d16204bf7c5724b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for huggingfacesync-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 96f29704bae399b9df55381825dd47380673134b2ad36a9837d707462ca4d7ce
MD5 14bf6e0da1c18f7b8ecab0663907ea5d
BLAKE2b-256 8da65428d7274e548084e6502a37937f385e2ce496121404c9027e7047758768

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