Skip to content

Commit ca9b5c1

Browse files
committed
update docs for 2.6.0
1 parent 1670cb0 commit ca9b5c1

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

docs/changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ hide:
77

88
Full release notes for the Python SDK are available on [GitHub](https://github.com/taskbadger/taskbadger-python/releases).
99

10+
## v2.6.0
11+
12+
**2026-08-11**
13+
14+
**Python SDK**
15+
16+
* **CHANGED** API requests now [time out](python.md#request-timeout) after 5 seconds instead of never. Override with `init(timeout=...)` or the `TASKBADGER_HTTP_TIMEOUT` environment variable, which the [CLI](cli.md#environment-variables) also honours.
17+
1018
## v2.5.2
1119

1220
**2026-08-07**

docs/cli.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ When using a legacy API key, the following additional variables are required:
114114
* `TASKBADGER_ORG`
115115
* `TASKBADGER_PROJECT`
116116

117+
Optional:
118+
119+
* `TASKBADGER_HTTP_TIMEOUT` — Timeout in seconds for API requests, 5 by default.
120+
See [Request timeout](python.md#request-timeout). ==Since v2.6.0==
121+
117122
### Configuration file
118123

119124
The CLI includes a convenience command to create the configuration file. Running the `configure`

docs/python.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ page in the [Task Badger dashboard](https://taskbadger.net).
3434
| systems | System integrations such as [Celery](python-celery.md) |
3535
| before_create | A function that is called before a task is created. See [Before Create Callback](#before-create-callback) |
3636
| context_providers | Providers that attach extra data to a task when it errors. See [Error Context Providers](#error-context-providers) |
37+
| timeout | Timeout for API requests. See [Request timeout](#request-timeout) |
3738
| organization_slug | The organization identifier. Only required for legacy API keys. |
3839
| project_slug | The project identifier. Only required for legacy API keys. |
3940

@@ -43,6 +44,33 @@ If you attempt to use the SDK without configuring it you will get an error. To a
4344
!!! tip
4445
[Tags](data_model.md#tags) provided here will be applied to all tasks created using the SDK. If you need to add tags to individual tasks you can do so using the create and update methods or the `task.add_tag` method. Tags added manually will override the global tags.
4546

47+
### Request timeout
48+
49+
==Since v2.6.0==
50+
51+
API requests time out after 5 seconds. Override it with the `timeout` argument, in seconds:
52+
53+
```python
54+
import taskbadger
55+
56+
taskbadger.init(token="YOUR_API_KEY", timeout=30)
57+
```
58+
59+
The `TASKBADGER_HTTP_TIMEOUT` environment variable sets the default when `timeout` isn't passed,
60+
and is also how you configure the timeout for the [CLI](cli.md#environment-variables).
61+
62+
For finer control pass an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/),
63+
which lets you set the connect, read, write and pool timeouts separately:
64+
65+
```python
66+
import httpx
67+
import taskbadger
68+
69+
taskbadger.init(token="YOUR_API_KEY", timeout=httpx.Timeout(10, connect=2))
70+
```
71+
72+
Passing `httpx.Timeout(None)` disables timeouts entirely.
73+
4674
## Usage
4775

4876
The SDK provides a [Task](#taskbadger.Task) class which offers a convenient interface to the API.

0 commit comments

Comments
 (0)