You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-1
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,7 @@ What follows is kind of a wiki...
71
71
-[AddressBook](#addressbook)
72
72
-[Directory and Users](#directory-and-users)
73
73
-[Calendar](#calendar)
74
+
-[Tasks](#tasks)
74
75
-[OneDrive](#onedrive)
75
76
-[Excel](#excel)
76
77
-[Sharepoint](#sharepoint)
@@ -377,6 +378,8 @@ calendar | 'Calendars.Read'
377
378
calendar_shared |'Calendars.Read.Shared'
378
379
calendar_all |'Calendars.ReadWrite'
379
380
calendar_shared_all |'Calendars.ReadWrite.Shared'
381
+
tasks |'Tasks.Read'
382
+
tasks_all |'Tasks.ReadWrite'
380
383
users |'User.ReadBasic.All'
381
384
onedrive |'Files.Read.All'
382
385
onedrive_all |'Files.ReadWrite.All'
@@ -988,7 +991,63 @@ for event in birthdays:
988
991
For some unknow reason, microsoft does not allow to upload an attachment at the event creation time (as opposed with message attachments).
989
992
See [this](https://stackoverflow.com/questions/46438302/office365-rest-api-creating-a-calendar-event-with-attachments?rq=1).
990
993
So, to upload attachments to Events, first save the event, then attach the message and save again.
991
-
994
+
995
+
## Tasks
996
+
997
+
The tasks functionality is grouped in a `ToDo`object. Note that the tasks functionality currently only works with the `MSOffice365Protocol` protocol.
998
+
999
+
A `ToDo` instance can listand create task folders. It can also listor create tasks on the default user folder. To use other folders use a `Folder` instance.
1000
+
1001
+
These are the scopes needed to work with the `ToDo`, `Folder`and`Task` classes.
1002
+
1003
+
Raw Scope | Included in Scope Helper | Description
1004
+
:---: | :---: |---
1005
+
*Tasks.Read*|*tasks*| To only read my personal tasks
1006
+
*Tasks.ReadWrite*|*tasks_all*| To read and save personal calendars
1007
+
1008
+
Working with the `ToDo` instance:
1009
+
```python
1010
+
import datetime as dt
1011
+
1012
+
# ...
1013
+
todo= account.tasks()
1014
+
1015
+
#list current tasks
1016
+
folder= todo.get_default_folder()
1017
+
new_task= folder.new_task() # creates a new unsaved task
1018
+
new_task.subject ='Send contract to George Best'
1019
+
new_task.due = dt.datetime(2020, 9, 25, 18, 30)
1020
+
new_task.save()
1021
+
1022
+
#some time later....
1023
+
1024
+
new_task.mark_completed()
1025
+
new_task.save()
1026
+
1027
+
# naive datetimes will automatically be converted to timezone aware datetime
1028
+
# objects using the local timezone detected or the protocol provided timezone
1029
+
# as with the Calendar functionality
1030
+
1031
+
```
1032
+
1033
+
Working with`Folder` instances:
1034
+
1035
+
```python
1036
+
#create a new folder
1037
+
new_folder= todo.new_folder('Defenders')
1038
+
1039
+
#rename a folder
1040
+
folder= todo.get_folder(folder_name='Strikers')
1041
+
folder.name ='Forwards'
1042
+
folder.update()
1043
+
1044
+
#list current tasks
1045
+
task_list= folder.get_tasks()
1046
+
for task in task_list:
1047
+
print(task)
1048
+
print('')
1049
+
```
1050
+
992
1051
## OneDrive
993
1052
The `Storage`class handles all functionality around One Drive and Document Library Storage in Sharepoint.
0 commit comments