Google Drive file updater
Project description
Google Drive file updater
A package that allows to backup local files to a specific google drive folder and update already backuped files if they were modified
Install
pip install google-drive-file-updater
Requirements
Credentials
- Create a Google project here: https://console.developers.google.com/
- Enable Google Drive API
- Create OAuth 2.0-Client-ID
- Download credentials.json file
Console script
gdfup.py [Source path] [Destination folder id] (optional: Path to credentials.json)
If no path to the credentials.json file is passed to the script, it will assume that the file is located in the folder in which the script is executed in.
Example:
You can find the id of a google drive folder in the url:
How to use in code
from gd_fup.service import GoogleDriveService
from gd_fup.updater import GoogleDriveFileUpdater
# drive_service = GoogleDriveService()
# optional: path_credentials --> path to your credentials.json file
# optional: path_token --> path in which your generated token will be saved
drive_service = GoogleDriveService(path_credentials=r'C:\Temp\credentials.json', path_token=r'C:\Temp\token.json')
# A new tab in your browser will open in order to sign in with your google account
drive_service.authenticate()
drive_file_updater = GoogleDriveFileUpdater(drive_service=drive_service, output_console=True)
drive_file_updater.update_files(
path_source=r'C:\Users\riffe\schule\5.klasse\pos\docs',
root_folder_id='1OEj4Giz1ILRekkWfPw27ZxmPaan-vq1G')
TODO
- Fix Google Drive file deletion bug
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file google-drive-file-updater-0.0.5.tar.gz.
File metadata
- Download URL: google-drive-file-updater-0.0.5.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4f7ae11f96bf898b8dc3bc4de51d16b7bc7f38822d43fab699ed979b490ffc4
|
|
| MD5 |
8fb976d0b116c14cc8f0688ee07aad05
|
|
| BLAKE2b-256 |
de9caf4cca123c0290e6beefef30cf75482965cd22c117e37eb38457e6c51e04
|
File details
Details for the file google_drive_file_updater-0.0.5-py3-none-any.whl.
File metadata
- Download URL: google_drive_file_updater-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81960a2915ac5caf4f37f9e367294a3a3afabd51792efe600c6ac17318bd5d81
|
|
| MD5 |
74137515b8723d837c3dbbfc9e0e93ca
|
|
| BLAKE2b-256 |
526f20919b65daa60792cbc3dcb27d8257462dd8507b0cc71c5516d7ea5b17fc
|