Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/apify_client/_apify_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down Expand Up @@ -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}')
Expand Down
Loading