Skip to main content

abstract_transfer

One transport for HTTP pulls, stdlib only. Generalised from hugpy's worker model pull (hugpy_storage.provision) so every project moves bytes the same way.

from abstract_transfer import fetch, chunk_sha256s
fetch("https://host/file", "/data/file", sha256="…")             # verified
fetch(url, dest, chunk_sums=sums, chunk_bytes=32 << 20)          # per-chunk verified, parallel
fetch(url, dest, validate=lambda p: open(p,"rb").read(4) == b"GGUF")

abstract-transfer URL DEST [--sha256 X] [--size N] [-H 'Authorization: Bearer …']

Guarantees

  • Complete-or-raise. Data lands in DEST.part; only after size, sha256 and validate() pass is it os.replaced to DEST. A file under its final name is whole.
  • Resume. Sequential pulls continue from the bytes already in .part (Range: bytes=N-); a server that answers 200 instead of 206 restarts cleanly.
  • Parallel segments when the server honours Range and the file is ≥ 64 MiB (or chunk_sums is given): concurrency connections, one chunk each.
  • Per-chunk SHA-256 (chunk_sums, from chunk_sha256s() on the server): each chunk is verified as it lands and recorded in DEST.part.state, so a crash resumes from proven content, not a byte offset.
  • Single-flight per destination: a thread lock plus an fcntl lock file — two pulls of the same file never interleave.

Used by

  • abstract-toolserver fileshare_fetch.
  • hugpy_storage (planned): its private _download_* helpers map 1:1 onto fetch.

Metadata

Release files for abstract-transfer 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for abstract-transfer 0.0.1
File Size Uploaded
abstract_transfer-0.0.1.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for abstract-transfer 0.0.1
File Interpreter ABI Platform
abstract_transfer-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / abstract_transfer-0.0.1.tar.gz

Download URL abstract_transfer-0.0.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b6cfe1a76d6ac3d1a2a894fafa4ef5d30cf875e3a17542fbe9bf6a6cac580904
BLAKE2b-256 checksum
How to use checksums
a0d5ae40f2471fd660a924fc7cdceb85c8dd0d9257eb3e43898054a29385de9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / abstract_transfer-0.0.1-py3-none-any.whl

Download URL abstract_transfer-0.0.1-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac38f3428c58750b11a9e4adc239fc60cf0287c2dedea28a378e1e153e294365
BLAKE2b-256 checksum
How to use checksums
fe1d94ed3ca945ee97feeb87f9ab858693e8757e1379da51c36728493e7f4f67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page