-
-
Notifications
You must be signed in to change notification settings - Fork 370
Expand file tree
/
Copy pathcreate.py
More file actions
17 lines (13 loc) · 530 Bytes
/
create.py
File metadata and controls
17 lines (13 loc) · 530 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
Creates a new folder
"""
from office365.sharepoint.client_context import ClientContext
from tests import test_team_site_url, test_user_credentials
ctx = ClientContext(test_team_site_url).with_credentials(test_user_credentials)
folder_name = "Reports" # creates a temporary folder first in Documents library
folder = (
ctx.web.default_document_library()
.root_folder.folders.add_using_path(folder_name, overwrite=True)
.execute_query()
)
print("Folder : {0} has been created".format(folder.serverRelativeUrl))