Client
Synchronous and asynchronous clients for Notion's API.
AsyncClient
Bases: BaseClient
Asynchronous client for Notion's API.
Source code in notion_client/client.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
aclose()
async
Close the connection pool of the current inner client.
Source code in notion_client/client.py
271 272 273 | |
request(path, method, query=None, body=None, form_data=None, auth=None)
async
Send an HTTP request asynchronously.
Source code in notion_client/client.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
Client
Bases: BaseClient
Synchronous client for Notion's API.
Source code in notion_client/client.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
close()
Close the connection pool of the current inner client.
Source code in notion_client/client.py
220 221 222 | |
request(path, method, query=None, body=None, form_data=None, auth=None)
Send an HTTP request.
Source code in notion_client/client.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
ClientOptions
dataclass
Options to configure the client.
Attributes:
| Name | Type | Description |
|---|---|---|
auth |
Optional[str]
|
Bearer token for authentication. If left undefined, the |
timeout_ms |
int
|
Number of milliseconds to wait before emitting a
|
base_url |
str
|
The root URL for sending API requests. This can be changed to test with a mock server. |
log_level |
int
|
Verbosity of logs the instance will produce. By default, logs are
written to |
logger |
Optional[Logger]
|
A custom logger. |
notion_version |
str
|
Notion version to use. |
Source code in notion_client/client.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |