Home
PymstodoError
Bases: Exception
Basic Pymstodo exception
Source code in pymstodo/client.py
15 16 17 18 19 |
|
Task
dataclass
To-Do task represents a task, such as a piece of work or personal item, that can be tracked and completed
Source code in pymstodo/client.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 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 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 |
|
body_text: str | None
property
The task body that typically contains information about the task
categories: list[str]
instance-attribute
The categories associated with the task
completedDateTime: _DateTimeTimeZone
instance-attribute
The date and time in the specified time zone that the task was finished. Uses ISO 8601 format
completed_date: datetime | None
property
The date and time in the specified time zone that the task was finished
createdDateTime: str
instance-attribute
The date and time when the task was created. It is in UTC and uses ISO 8601 format
created_date: datetime | None
property
The date and time when the task was created. It is in UTC
dueDateTime: _DateTimeTimeZone
instance-attribute
The date and time in the specified time zone that the task is to be finished. Uses ISO 8601 format
due_date: datetime | None
property
The date and time in the specified time zone that the task is to be finished
hasAttachments: bool
instance-attribute
Indicates whether the task has attachments
importance: Literal['low', 'normal', 'high']
instance-attribute
The importance of the task. Possible values are: low
, normal
, high
isReminderOn: bool
instance-attribute
Set to true if an alert is set to remind the user of the task
lastModifiedDateTime: str
instance-attribute
The date and time when the task was last modified. It is in UTC and uses ISO 8601 format
last_mod_date: datetime | None
property
The date and time when the task was last modified. It is in UTC
reminderDateTime: _DateTimeTimeZone
instance-attribute
The date and time in the specified time zone for a reminder alert of the task to occur. Uses ISO 8601 format
reminder_date: datetime | None
property
The date and time in the specified time zone for a reminder alert of the task to occur
startDateTime: _DateTimeTimeZone
instance-attribute
The date and time in the specified time zone at which the task is scheduled to start. Uses ISO 8601 format
start_date: datetime | None
property
The date and time in the specified time zone at which the task is scheduled to start
task_id: str
instance-attribute
Unique identifier for the task. By default, this value changes when the item is moved from one list to another
task_status: TaskStatus
property
Indicates the state or progress of the task
title: str
instance-attribute
A brief description of the task
TaskList
dataclass
To-Do task list contains one or more task
Source code in pymstodo/client.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
displayName: str
instance-attribute
The name of the task list
isOwner: bool
instance-attribute
True
if the user is owner of the given task list
isShared: bool
instance-attribute
True
if the task list is shared with other users
link: str
property
Link to the task list on web.
list_id: str
instance-attribute
The identifier of the task list, unique in the user's mailbox. Read-only
wellknown_list_name: WellknownListName | None
property
Property indicating the list name if the given list is a well-known list
TaskStatus
Bases: Enum
The state or progress of the task
Attributes:
Name | Type | Description |
---|---|---|
notStarted |
not started |
|
inProgress |
in progress |
|
completed |
completed |
|
waitingOnOthers |
waiting on others |
|
deferred |
deferred |
Source code in pymstodo/client.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
TaskStatusFilter
Bases: Enum
Tasks status filter
Attributes:
Name | Type | Description |
---|---|---|
completed |
only completed tasks |
|
notCompleted |
only non-completed tasks |
|
all |
all tasks |
Source code in pymstodo/client.py
77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
ToDoConnection
To-Do connection is your entry point to the To-Do API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client_id |
str
|
API client ID |
required |
client_secret |
str
|
API client secret |
required |
token |
Token
|
Token obtained by method |
required |
Source code in pymstodo/client.py
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 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 |
|
complete_task(task_id, list_id)
Complete a task
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id |
str
|
Unique identifier for the task |
required |
list_id |
str
|
Unique identifier for the task list |
required |
Returns:
Type | Description |
---|---|
Task
|
A completed task |
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
532 533 534 535 536 537 538 539 540 541 542 543 544 |
|
create_list(name)
Create a new task list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Title of the new task list |
required |
Returns:
Type | Description |
---|---|
TaskList
|
A created task list |
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
|
create_task(title, list_id, due_date=None, body_text=None)
Create a new task in a specified task list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str
|
A brief description of the task |
required |
list_id |
str
|
Unique identifier for the task list |
required |
due_date |
datetime | None
|
The date and time that the task is to be finished |
None
|
body_text |
str | None
|
Information about the task |
None
|
Returns:
Type | Description |
---|---|
Task
|
A created task |
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
|
delete_list(list_id)
Delete a task list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_id |
str
|
Unique identifier for the task list |
required |
Returns:
Type | Description |
---|---|
bool
|
|
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
|
delete_task(task_id, list_id)
Delete a task
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id |
str
|
Unique identifier for the task |
required |
list_id |
str
|
Unique identifier for the task list |
required |
Returns:
Type | Description |
---|---|
bool
|
|
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 |
|
get_auth_url(client_id)
staticmethod
Get the authorization_url
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client_id |
str
|
API client ID |
required |
Returns:
Type | Description |
---|---|
Any
|
Authorization URL to show to the user |
Source code in pymstodo/client.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
get_list(list_id)
Read the properties of a task list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_id |
str
|
Unique identifier for the task list |
required |
Returns:
Type | Description |
---|---|
TaskList
|
A task list object |
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
|
get_lists(limit=99)
Get a list of the task lists
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit |
int | None
|
The limit size of the response |
99
|
Returns:
Type | Description |
---|---|
list[TaskList]
|
A list of the task lists |
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
get_task(task_id, list_id)
Read the properties of a task
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id |
str
|
Unique identifier for the task |
required |
list_id |
str
|
Unique identifier for the task list |
required |
Returns:
Type | Description |
---|---|
Task
|
A task object |
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
|
get_tasks(list_id, limit=1000, status=TaskStatusFilter.NOT_COMPLETED)
Get tasks by a specified task list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_id |
str
|
Unique identifier for the task list |
required |
limit |
int | None
|
The limit size of the response |
1000
|
status |
TaskStatusFilter | None
|
The state or progress of the task |
TaskStatusFilter.NOT_COMPLETED
|
Returns:
Type | Description |
---|---|
list[Task]
|
Tasks of a specified task list |
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 |
|
get_token(client_id, client_secret, redirect_resp)
staticmethod
Fetch the access token
Source code in pymstodo/client.py
275 276 277 278 279 280 |
|
update_list(list_id, **list_data)
Update the properties of a task list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_id |
str
|
Unique identifier for the task list |
required |
list_data |
str | bool
|
Task properties from |
{}
|
Returns:
Type | Description |
---|---|
TaskList
|
An updated task list. |
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
|
update_task(task_id, list_id, **task_data)
Update the properties of a task
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id |
str
|
Unique identifier for the task |
required |
list_id |
str
|
Unique identifier for the task list |
required |
task_data |
str | int | bool
|
Task properties from |
{}
|
Returns:
Type | Description |
---|---|
Task
|
An updated task |
Raises:
Type | Description |
---|---|
PymstodoError
|
An error occurred accessing the API |
Source code in pymstodo/client.py
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 |
|
WellknownListName
Bases: Enum
Well-known list name
Attributes:
Name | Type | Description |
---|---|---|
DEFAULT_LIST |
Default list |
|
FLAGGED_EMAILS |
Flagged emails |
|
UNKNOWN_FUTURE_VALUE |
Unknown future value |
Source code in pymstodo/client.py
43 44 45 46 47 48 49 50 51 52 53 54 55 |
|