macrosynergy.download.dataquery_file_api.segmented_file_downloader#

class SegmentedFileDownloader(filename, url, headers, params, proxies=None, chunk_size=8192, segment_size_mb=8.0, timeout=300.0, api_delay=0.04, api_delay_margin=1.05, headers_timeout=60.0, max_concurrent_downloads=None, max_file_retries=3, verify_ssl=True, start_download=False, *, parent_requester, debug=False)[source]#

Bases: object

A utility class to manage the multi-part, concurrent download of a single large file.

log(msg, part_num=None, level=20)[source]#

Logs a message with downloader-specific context.

download(retries=None)[source]#

Orchestrates the entire file download process, including retries.

Return type:

Path

cleanup()[source]#

Removes the temporary directory and all downloaded parts.