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
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 240 241 242 243 244 |
|
aclose()
async
Close the connection pool of the current inner client.
Source code in notion_client/client.py
226 227 228 |
|
request(path, method, query=None, body=None, auth=None)
async
Send an HTTP request asynchronously.
Source code in notion_client/client.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
|
Client
Bases: BaseClient
Synchronous client for Notion's API.
Source code in notion_client/client.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
close()
Close the connection pool of the current inner client.
Source code in notion_client/client.py
176 177 178 |
|
request(path, method, query=None, body=None, auth=None)
Send an HTTP request.
Source code in notion_client/client.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
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
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|