Can I edit an excel file on onedrive using python? - python

I have been searching for hours trying to find out how I could edit an Excel file saved to OneDrive using python and have had no luck. Help if you know how/if it is possible.

#JeremiahTrest Welcome to Stackoverflow. I don't think that's how OneDrive works. What I mean is, I don't think it's possible to directly edit a file that is saved to your OneDrive in the cloud with any language. What you would have to do is to get a copy of the file on the machine that is running the Python script, update the file on that machine and save it with the changes, then push the changed file to your OneDrive. I looked and found this SDK for Python that is meant to be able to help you interface with the OneDrive API. So, you would use this SDK to get the file from OneDrive, update the file locally, then use the SDK to push the changed file back out to OneDrive.

I came across this post as I have the same task. Here's what I'm going to try:
Use the request library on python to call the OneDrive API.
Here's the page on excel APIs:
enter link description here
I'll update when I have my code.

Related

Accessing public google drive file from python colab

I have the following link:
https://drive.google.com/file/d/XXXX/view?usp=sharing
It's a csv file, with public access which i want to use as a dataset.
I don't know it's name, i want to access it and read it's content simple as possible.
This notebook should run in different environments should it download the file on execution.
I've tried pydrive but the authentication was a mess.
Quick help would be appreciated, snippets are welcome

Python workaround for functions that don't recognise a URL as a file path?

I am using the ecommercetools package to access the Google Search Console API as described here - https://practicaldatascience.co.uk/data-science/how-to-access-the-google-search-console-api-using-python .
This is working fine on my local machine. However, I want to run it in a Runbook on Azure. So I have stored the key json file in blob storage.
The issue seems to be that seo.query_google_search_console() does not recognise the Blob SAS URL of the file as a file path.
Is there some way to work around this? Is it possible to hold a virtual file in memory and refer to it instead? Would appreciate any advice!

How to upload file using service account and python

I currently have a python code and already created a service account. I now need a way in order to upload file into a google drive folder shared to the service account.
Bonus points is finding first if a certain folder already exists, if not create the folder then upload the file over there.
Check the Google Drive API documentation and specially the Quickstart guide with Python. Also, read this Stack Overflow guide to learn how to write good questions. :D

How to save excel file to amazon s3 from python or ruby

Is it possible to create a new excel spreadsheet file and save it to an Amazon S3 bucket without first saving to a local filesystem?
For example, I have a Ruby on Rails web application which now generates Excel spreadsheets using the write_xlsx gem and saving it to the server's local file system. Internally, it looks like the gem is using Ruby's IO.copy_stream when it saves the spreadsheet. I'm not sure this will work if moving to Heroku and S3.
Has anyone done this before using Ruby or even Python?
I found this earlier question, Heroku + ephemeral filesystem + AWS S3. So, it would seem this is not possible using Heroku. Theoretically, it would be possible using a service which allows adding an Amazon EBS.
You have dedicated Ruby Gem to help you moving file to Amazon S3:
https://rubygems.org/gems/aws-s3
If you want more details about the implementation, here is the git repository. The documentation on the page is very complete, and explain how to move file to S3. Hope it helps.
Once your xls file is created, the library helps you create a S3Objects and store it into a Bucket (which you can also create with the library).
S3Object.store('keyOfYourData', open('nameOfExcelFile.xls'), 'bucketName')
If you want more choice, Amazon also delivered an official Gem for this purpose: https://rubygems.org/gems/aws-sdk

How can I use Google documents list APIs with the none-document files such as .jpeg .gif?

I'm now using gdata-python-client(Google document List API) to access my google drive on Terminal in Linux OS and I have problem to show the image files -- It's just show only the .doc .xls or .pdf files
Is it has some solutions to solve my problem in still using gdata-python-client? I hope there is some solutions better than changing my APIs to Google drive API,that's mean I should restart my project!!. So sad :(
And If I change to use Google Drive APIs.how to do it? or can i reuse my project working compatibility with the new APIs?
Please give me some advice or tutorial.
Thank you very very very much :)
Use the Drive API. We have a Python command line sample to get you started, and python snippets for every API method including files.list.

Categories