I am automatically uploading a file on google drive (using google drive API).
I would like to rename the file while uploading it (as its label is originally the full path directory of the file, which is pretty long).
I am using this function to upload the file on gdrive:
def upload_file_gdrive(file_path, base_currency, gdrive_path_id):
# Authentication (automated using the config files)
# The config files should be dropped in the current working directory
gauth = GoogleAuth()
drive = GoogleDrive(gauth)
# Upload file on gdrive
print('Uploading the market data on google drive')
gfile = drive.CreateFile({'parents': [{'id': gdrive_path_id}]})
gfile.SetContentFile(file_path)
gfile.Upload() # Upload the file.
print('Market data upload on google drive successful')
Do we have a way to rename the file while uploading it ?
Cheers