Skip to main content

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

  1. Create a Google project here: https://console.developers.google.com/
  2. Enable Google Drive API
  3. Create OAuth 2.0-Client-ID
  4. 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:

sample_1

You can find the id of a google drive folder in the url:

sample_2

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google-drive-file-updater-0.0.5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_drive_file_updater-0.0.5-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

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

Hashes for google-drive-file-updater-0.0.5.tar.gz
Algorithm Hash digest
SHA256 b4f7ae11f96bf898b8dc3bc4de51d16b7bc7f38822d43fab699ed979b490ffc4
MD5 8fb976d0b116c14cc8f0688ee07aad05
BLAKE2b-256 de9caf4cca123c0290e6beefef30cf75482965cd22c117e37eb38457e6c51e04

See more details on using hashes here.

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

Hashes for google_drive_file_updater-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 81960a2915ac5caf4f37f9e367294a3a3afabd51792efe600c6ac17318bd5d81
MD5 74137515b8723d837c3dbbfc9e0e93ca
BLAKE2b-256 526f20919b65daa60792cbc3dcb27d8257462dd8507b0cc71c5516d7ea5b17fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page