Programatically accessing files shared in teams

New Contributor

My group has filed stored in teams channels. They're basically using excel files for data entry. I'd like to access them automatically/programatically for data analysis.

Ideally in Python, but I'm open to any language.


ANY solution that automatically mirrors a Teams file to a hard drive would be wonderful as an alternative. 


There is a REST API for 365 but it doesn't seem to provide the functionality I need based on the docs, it's only for accessing files in public chat?


See my stack overflow post here if you want to dive into some code:

5 Replies

Hi @cklapperichmn,


I hope I get your needs right. From my point of view, you just need to build a flow that copies the files from the SharePoint Online folder to another place where you can grab them? Maybe you should have a look at this option...




@svenseidenbergThanks so much. You have a good grasp of my problem/needs, yp!


I manged to set up a "folder sync" that moves them to a local place on my C:\ drive but a network drive would be cooler. Now people edit documents in teams and it shows up on my hard drive! I can't figure out how to change the sync to another folder. is there a way to do this?


Or, any good tutorials for setting up a flow to move from Sharepoint to a network dir?






I am not able see the option which you mentioned. My requirement is also similar. I have to access all the files present in a folder (in MS Teams) and get those into PowerBI and later use them for file manipulation.



MS TEAMS (folder, containing files)----------------accessed by----------------------> PowerBI (containing python script).


I need to access all these files using python, and the python script is in powerBI


Thanks and regards.


@hanumntha03I got this working. I used the "open in sharepoint" option in teams, then used the "sync" option to sync the folder to a local folder on the hard drive. Then python could read from the local folder and the data stayed up to date. Worked well. Must have the one-drive app running on your PC.




so can't we directly access files without "using them in sharepoint". I have seen that there is an option given for a folder where we can use the "copy link" option can we use this to get all files in the folder?