from office365.sharepoint.client_context import ClientContext ctx = ClientContext.connect_with_credentials(url,UserCredential(username, password)) web = ctx.web ctx ...