Skip to main content

abstraction-download, in Python

A download that outlives the process that asked for it. What was asked for, how far it got and who may work on it live in a record on disk, so a transfer this process starts, the next launch — or another machine — can finish. Standard library only.

This page is the Python package. The contract, the Go and C++ implementations, what is measured and what is UNPROVEN are on the repository.

Install

Not on PyPI, and the names on PyPI are not ours. Clone the five repositories beside each other and install them in dependency order:

git clone https://github.com/openabstractions/abstraction-cas
git clone https://github.com/openabstractions/abstraction-watch
git clone https://github.com/openabstractions/abstraction-job
git clone https://github.com/openabstractions/abstraction-config
git clone https://github.com/openabstractions/abstraction-download

pip install ./abstraction-cas/python ./abstraction-watch/python
pip install ./abstraction-job/python ./abstraction-config/python
pip install ./abstraction-download/python

Python 3.9 or later. The order is not a style: pyproject.toml names these dependencies by the names they would have on an index, and pip can only satisfy them from what is installed already.

Copying the modules works too, and is the route the one shipped adopter takes. abstraction_cas.py, abstraction_watch.py, abstraction_job.py, abstraction_config.py and abstraction_download.py are pure standard library, so a _vendor/ directory of your own is a complete installation — see adopter-comfyui.

An example that runs

import abstraction_download as dl

svc = dl.discover()
print("who would fetch this:", svc.where())

job = svc.get("https://raw.githubusercontent.com/openabstractions/abstractions/main/LICENSE", "LICENSE.txt")
record = svc.deliver(job)
print("bytes are at:", dl.spec_of(record).sink.final)

Nothing needs configuring and no service needs to be running. On a machine with neither it prints who would fetch this: here and the path the file landed at. get returns a job id at once and the transfer may outlive this call and this process; deliver waits for the bytes and takes delivery, which is what a caller that reads the file on the next line needs. where names who would take the next job — here, bits, nas, nobody — as text for a status line, not a value to branch on.

Your application was closed mid-transfer. This is the next launch finishing what nobody is working on, before it asks for anything new:

import abstraction_download as dl

print("resumed:", dl.discover().runner.adopt())

What an application calls

call what it does
discover() a Client for this machine's store. Names no path
Client.get(source, destination) fetch a URL to a path. Returns a job id now; the work may outlive the process
Client.submit(spec, requires=[...]) get for a caller with a digest to verify, several sources, or capabilities an implementation must have
Client.deliver(job_id, timeout=None) block until the bytes are here, take delivery, return the record
Client.take_delivery(job_id) "I have it". A finished transfer is not collected until somebody says so, and uncollected ones accumulate
Client.jobs() every download on this machine, as a snapshot
Client.where() who would perform a job submitted now
Client.runner.adopt() finish downloads nobody is working on. Returns how many

A Spec is what to fetch: an Artifact (digest, size), an ordered list of Source locators, and a Sink naming where the bytes go.

dl.Spec(
    artifact=dl.Artifact(digest="sha256:...", size=328597408),
    sources=[dl.Source(scheme="https", locator="https://...")],
    sink=dl.Sink(final="models/x.gguf"),
)

Capabilities requires accepts: dl.CAP_RESUME, dl.CAP_SURVIVES_PROCESS_EXIT, dl.CAP_VERIFIES, dl.CAP_DELEGATES. Every normative rule is on CONTRACT.md, tagged; none is restated here.

What may break

  • The bytes are fetched by this process and they stop when it stops. They resume when it starts again; nothing arrives while your application is closed. Requiring CAP_SURVIVES_PROCESS_EXIT from Python is refused, not silently downgraded — that needs service-jobd, which is a Go binary a Python application cannot ship.
  • No tagged release and no package index. Pin a commit you have read.
  • watch, which this depends on, carries no conformance verdict. What is proven and what is not.
  • Every published transcript was produced on Windows or Linux. macOS is UNPROVEN throughout.

Apache-2.0. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstraction_download-0.1.0.tar.gz (48.9 kB view details)

Uploaded Source

Built Distribution

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

abstraction_download-0.1.0-py3-none-any.whl (49.7 kB view details)

Uploaded Python 3

File details

Details for the file abstraction_download-0.1.0.tar.gz.

File metadata

  • Download URL: abstraction_download-0.1.0.tar.gz
  • Upload date:
  • Size: 48.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for abstraction_download-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e4d7034b57a359f8d7f07ac0dfdc5b5fddc311c7db96bc12247f9d4c7cffe419
MD5 1bb778d03a5497ef10e6b7260b2afa33
BLAKE2b-256 8ee6dcd251249fed10e0b9aa4474003d9b5486dbcc3991899e167fc33c19d7c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstraction_download-0.1.0.tar.gz:

Publisher: publish.yml on openabstractions/abstraction-download

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

File details

Details for the file abstraction_download-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for abstraction_download-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 020db0a74c302141bdafe3c0500dc14f81e4ba964a69cd5c318a39a32ffbb1fb
MD5 e83947e9425bb48b2e951ed5ad4dde84
BLAKE2b-256 71d21990323d58688e7d8736b889fb31cabd46279878a005f9c9fda0d818cab2

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstraction_download-0.1.0-py3-none-any.whl:

Publisher: publish.yml on openabstractions/abstraction-download

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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