I'm looking to create a simple Python script that lets me access a file via its URL, such as a Google Docs or Excel file, as long as the file is set to public access. The goal is to allow my coworkers and me to update the file from our own devices without needing the actual file downloaded. For instance, if we have a public Excel sheet for logging our clock in/out times, I'd love for each of us to run the script to write to that file directly using its link, and see updates in real-time since it's public. I've tried using the requests library and urlopen to turn the file into a dataframe, but I haven't had much luck. Any guidance on how to achieve this would be really appreciated!
4 Answers
You should definitely consider using the official API for Google Docs or whatever service you're using. For Google, check out their documentation here: [Google API Reference](https://developers.google.com/workspace/docs/api/reference/rest). It'll guide you on how to set it up correctly!
You mentioned a public Excel sheet for you and your coworkers. Just a thought—there might be better options for collaborative tools that don't rely on file storage for multiple users. Have you explored platforms specifically designed for that?
The approach really depends on the type of document. For example, if you're working with Google Sheets, their API has a comprehensive guide that may help. You can find it here: [Google Sheets API Guide](https://developers.google.com/workspace/sheets/api/guides/concepts).
If you're talking about files on platforms like Google Docs or Microsoft Office, you should use their APIs to interact with the files. Simply accessing the files through HTTP won't be enough since those services have specific ways to handle file manipulations.
I'm quite new to programming, so I'm open to suggestions! What alternatives do you have in mind?