Nixtla Client
source
ApiError
Common base class for all non-exit exceptions.
source
NixtlaClient
Client to interact with the Nixtla API.
Type | Default | Details | |
---|---|---|---|
api_key | Optional | None | The authorization api_key interacts with the Nixtla API. If not provided, will use the NIXTLA_API_KEY environment variable. |
base_url | Optional | None | Custom base_url. If not provided, will use the NIXTLA_BASE_URL environment variable. |
timeout | int | 60 | Request timeout in seconds. Set this to None to disable it. |
max_retries | int | 6 | The maximum number of attempts to make when calling the API before giving up. It defines how many times the client will retry the API call if it fails. Default value is 6, indicating the client will attempt the API call up to 6 times in total |
retry_interval | int | 10 | The interval in seconds between consecutive retry attempts. This is the waiting period before the client tries to call the API again after a failed attempt. Default value is 10 seconds, meaning the client waits for 10 seconds between retries. |
max_wait_time | int | 360 | The maximum total time in seconds that the client will spend on all retry attempts before giving up. This sets an upper limit on the cumulative waiting time for all retry attempts. If this time is exceeded, the client will stop retrying and raise an exception. Default value is 360 seconds, meaning the client will cease retrying if the total time spent on retries exceeds 360 seconds. The client throws a ReadTimeout error after 60 seconds of inactivity. If you want to catch these errors, use max_wait_time >> 60. |
Now you can start to make forecasts! Let’s import an example: