If you have an unstable connection, sometimes you might want to overwrite the defaults of the RequestsSettings. These settings propagate to the Project and Dataset objects that are created from the EncordUserClient.

You can overwrite the timeouts for read and write operations. The following script overwrites the read, write, and connect timeouts. Ensure that you replace ‘private_key_path’ with the full path to your private key.

# Import dependencies
from encord import EncordUserClient
from encord.http.constants import RequestsSettings

# Replace the number 300 with the number of seconds you want to set the timeout to
NEW_TIMEOUT = 300

request_settings = RequestsSettings(
    connect_timeout=NEW_TIMEOUT,
    read_timeout=NEW_TIMEOUT,
    write_timeout=NEW_TIMEOUT,
)

#Authenticate using the path to your private key
user_client = EncordUserClient.create_with_ssh_private_key(
    ssh_private_key_path="<private_key_path>",
    requests_settings=request_settings
    )