python-o365
python-o365 copied to clipboard
`drive.get_items()` do not return `File` type `DriveItem`s, just `Folder` type ones
As the title says. I only get the folders returned from the root, the files are omitted. In child folders the files are returned as well. Is this intended?
can you share the code? what's drive there?
credentials = (
app.config.get("SP_CLIENT_ID"),
app.config.get("SP_CLIENT_SECRET"),
)
token_backend = FileSystemTokenBackend(
token_path=app.config.get("SP_TOKEN_PATH"),
token_filename=app.config.get("SP_TOKEN_FILE"),
)
account = Account(
credentials=credentials,
auth_flow_type="credentials",
token_backend=token_backend,
tenant_id=app.config.get("SP_TENANT_ID"),
)
site = account.sharepoint().get_site(app.config.get("SP_SITE_ID"))
drive = site.list_document_libraries()[0]
drive.get_items()
The last line returns:
[Folder: copies,
Folder: copytest,
Folder: url,
Folder: vta,
Folder: vta_copy]
But actually opening the sharepoint drive I can see that the root folder has tons of different files next to these folders. So only Folder subtyped DriveItems are returned.