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
230 231 232 233 234 235 236 237 238 239 240 241 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 |
|
aclose()
async
Close the connection pool of the current inner client.
Source code in notion_client/client.py
259 260 261 |
|
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
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
|
Client
Bases: BaseClient
Synchronous client for Notion's API.
Source code in notion_client/client.py
179 180 181 182 183 184 185 186 187 188 189 190 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 |
|
close()
Close the connection pool of the current inner client.
Source code in notion_client/client.py
208 209 210 |
|
request(path, method, query=None, body=None, form_data=None, auth=None)
Send an HTTP request.
Source code in notion_client/client.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|
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
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|