nix-prefetch-url wrapper
See also documentation for nix-prefetch-url.
Info
All requests to the functions are automatically cached.
prefetch_url
async
prefetch_url(
url: str,
*,
unpack: bool = False,
name: str | None = None,
) -> URLPrefetchResult
Wrap nix-prefetch-url to handle edge-cases like caching.
Parameters
unpack:
Whether to automatically unpack the archive (raises an error if the
provided URL is not an archive).
name: A custom name to give in the Nix store.
Raises
URLPrefetchError:
If `nix-prefetch-url` returned non-zero exit code or wrote
something to stderr.
prefetch_obj
async
prefetch_obj(obj: Prefetchable) -> URLPrefetchResult
Convenience function for objects that implement get_prefetch_url().
This function is practically useless because of superior NURL wrapper.
Response classes
URLPrefetchResult
URLPrefetchError
Bases: NetworkError