vgrem / Office365-REST-Python-Client

Microsoft 365 & Microsoft Graph Library for Python
MIT License
1.3k stars 332 forks source link

Is there a method to fire Delta Query for SharePoint Documents using Office365-REST-Python-Client? #633

Open mingchun-zhao opened 1 year ago

mingchun-zhao commented 1 year ago

Hi, Is there a method to fire Delta Query for SharePoint Documents using Office365-REST-Python-Client?

ssmails commented 7 months ago

Hello @mingchun-zhao , if it helps, I use the filter query to get the files created/updated after a certain date, as below.

However, @vgrem , I was also wondering if there's an example to run the delta query from the Graph Api using this lib. Since delta queries are the recommended approach by Microsoft. Also, related questions https://github.com/vgrem/Office365-REST-Python-Client/issues/822 https://github.com/vgrem/Office365-REST-Python-Client/issues/821

   items = (
    ctx.web.lists.get_by_title(doc_lib)
    .items.select(["FileSystemObjectType"]).filter("Modified gt '2024-02-10T08:23:03Z'").expand(["File", "Folder"])
    .get_all()
    .execute_query()
)
print("Loaded items count: {0}".format(len(items)))
ssmails commented 7 months ago

@vgrem any help appreciated on this. Thanks.