I want to find a free cloud storage service with free API, that could help me back up some files automatically.
I want to write some script (for example python) to upload files automatically.
I investigated OneDrive and GoogleDrive. OneDrive API is not free, GoogleDrive API is free while it need human interactive authorization before using API.
For now I'm simply using email SMTP protocol to send files as email attachments, but there's a max file size limition, which will fail me in the future, as my file size is growing.
Is there any other recommendations ?
I believe your goal as follows.
At first, in your situation, how about using google-api-python-client? In this answer, I would like to explain the following flow and the sample script using google-api-python-client.
Usage:
1. Create service account.
Please create the service account and download a JSON file. Ref
2. Install
google-api-python-client
.In order to use the sample script, please install
google-api-python-client
.3. Prepare a folder.
Please create a new folder in your Google Drive. And, please share the created folder with the email of your service account. Because the Google Drive of your account is different from the Drive of service account. By sharing the folder with the service account, the file can be uploaded to the folder in your Google Drive using the service account. By this, you can see the uploaded file on your Google Drive by your browser.
4. Prepare sample script.
Please set the filename of credentials of service account, the filename of the file you want to upload and the folder ID of folder you shared your folder with the service account to the variables of
SERVICE_ACCOUNT
,UPLOAD_FILE
andFOLDER_ID
, respectively.file = MediaFileUpload(UPLOAD_FILE, resumable=True)
tofile = MediaFileUpload(UPLOAD_FILE, mimeType='###', resumable=True)
.References: