DownloadPolicy#

class scikitplot.corpus.DownloadPolicy(name='secure', timeout=30.0, max_bytes=104857600, verify_ssl=True, block_private_ips=True, max_redirects=5, user_agent='Mozilla/5.0 (compatible; scikitplot-corpus/1.0; +https://github.com/scikit-plots/scikit-plots)', max_retries=3, retry_backoff=1.0)[source]#

Transport/resource policy shared by Corpus downloaders.

This object intentionally contains no credentials, headers or destination paths, so it is safe to serialize in plans and diagnostics.

Parameters:
block_private_ips: bool = True#
classmethod constrained()[source]#

Return a smaller CI/docs-friendly resource budget.

Return type:

DownloadPolicy

classmethod from_config(config)[source]#

Build from JSON/YAML-shaped configuration with typo rejection.

Parameters:

config (Mapping[str, Any])

Return type:

DownloadPolicy

classmethod large_files()[source]#

Allow large transfers without relaxing TLS or SSRF protections.

Return type:

DownloadPolicy

max_bytes: int = 104857600#
max_redirects: int = 5#
max_retries: int = 3#
name: str = 'secure'#
retry_backoff: float = 1.0#
classmethod secure()[source]#

Return the security-first library defaults.

Return type:

DownloadPolicy

timeout: float = 30.0#
to_dict()[source]#

Return a JSON-compatible policy representation.

Return type:

dict[str, Any]

to_kwargs()[source]#

Return constructor kwargs for downloader classes.

Return type:

dict[str, Any]

user_agent: str = 'Mozilla/5.0 (compatible; scikitplot-corpus/1.0; +https://github.com/scikit-plots/scikit-plots)'#
verify_ssl: bool = True#