diff --git a/src/apify_client/_apify_client.py b/src/apify_client/_apify_client.py index aac0da66..255c87ea 100644 --- a/src/apify_client/_apify_client.py +++ b/src/apify_client/_apify_client.py @@ -154,11 +154,14 @@ def __init__( user_agent_suffix: Extra part or parts appended to the default `User-Agent` header, separated by `; `, for example to identify the tool built on top of the client. With `with_custom_http_client`, pass it to the HTTP client's constructor. - compression: Compression algorithm for request bodies. Pass a string literal to select an algorithm, - or an `HttpCompressor` instance for finer-grained control. + compression: Compression algorithm for request bodies. Defaults to `'gzip'`. Pass a string literal to select + an algorithm, or an `HttpCompressor` instance for finer-grained control. `'brotli'` needs the `brotli` + extra (`pip install "apify-client[brotli]"`). It is not the default because the `brotli` package is a C + extension, while gzip support is part of the Python standard library. Raises: ValueError: If `max_retries` is negative. + ImportError: If `compression` is `'brotli'` and the `brotli` extra is not installed. """ if max_retries < 0: raise ValueError(f'max_retries must be a non-negative integer, got {max_retries}') @@ -534,11 +537,14 @@ def __init__( user_agent_suffix: Extra part or parts appended to the default `User-Agent` header, separated by `; `, for example to identify the tool built on top of the client. With `with_custom_http_client`, pass it to the HTTP client's constructor. - compression: Compression algorithm for request bodies. Pass a string literal to select an algorithm, - or an `HttpCompressor` instance for finer-grained control. + compression: Compression algorithm for request bodies. Defaults to `'gzip'`. Pass a string literal to select + an algorithm, or an `HttpCompressor` instance for finer-grained control. `'brotli'` needs the `brotli` + extra (`pip install "apify-client[brotli]"`). It is not the default because the `brotli` package is a C + extension, while gzip support is part of the Python standard library. Raises: ValueError: If `max_retries` is negative. + ImportError: If `compression` is `'brotli'` and the `brotli` extra is not installed. """ if max_retries < 0: raise ValueError(f'max_retries must be a non-negative integer, got {max_retries}')