Klapr.zip | Download
class ZipDownloadError(RuntimeError): """Base class for errors raised by `download_and_extract`."""
Parameters ---------- url : str Direct URL to the ZIP file (e.g., "https://example.com/Klapr.zip"). dest_dir : Path | str | None, optional Where to place the extracted files. * If ``None`` (default), a temporary directory is created and its Path is returned. * If an existing directory is passed, the archive is extracted **into** that folder. * If the path points to a non‑existent location, it will be created. checksum : str | None, optional Expected checksum of the downloaded file (hex string). If provided, the file’s checksum (using `checksum_algo`) is compared and a ``ZipDownloadError`` is raised on mismatch. checksum_algo : str, default "sha256" Hash algorithm to use for the checksum (e.g., "md5", "sha1", "sha256"). timeout : int, default 30 Seconds to wait for the HTTP request before timing out. chunk_size : int, default 8192 Size of the buffer when streaming the download. Download Klapr.zip
# ------------------------------------------------------------------ # # 2️⃣ Prepare a temporary file for the download # ------------------------------------------------------------------ # temp_file = Path(tempfile.mkstemp(suffix=".zip")[1]) * If an existing directory is passed, the
Returns ------- Path Path to the directory containing the extracted contents. chunk_size : int