Skip to content
This repository has been archived by the owner on Sep 17, 2022. It is now read-only.

A script that cleans up PDF's in a folder by searching for them in google drive and uploading them if not available

License

Notifications You must be signed in to change notification settings

Lesekater/Download-Folder-Cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

== This Project was moved to Codeberg ==

GitHub is a proprietary, trade-secret system that is not Free and Open Souce Software (FOSS). We urge you to read about the Give up GitHub campaign from the Software Freedom Conservancy to understand some of the reasons why GitHub is not a good place to host FOSS projects.

Any use of this project's code by GitHub Copilot, past or present, is done without our permission. We do not consent to GitHub's use of this project's code in Copilot.

Logo of the GiveUpGitHub campaign

Download-Folder-Cleanup

https://github.com/Lesekater/Download-Folder-Cleanup

A script that cleans up PDF's in a folder by searching for them in google drive through the google drive api and uploading them if not available

Description

downloadandcomare.py

For a given directory, this script goes through the main folder and searches and compares every pdf-file by name with google drive. Based on the result it ether uploads or just moves the file to a newly generated "uploaded" folder.


Installation

Ubuntu: A version of Python is already installed.
Mac OS X: A version of Python is already installed. (SCRIPT IS NOT TESTED!!)
Windows: You will need to install one of the 3.x versions available at python.org. (SCRIPT IS NOT TESTED!!)

Dependencies

The script requires additional Python packages to run on the command line.

To install the Google client library for Python, run the following command: pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

To install python-magic follow the instructions on pypi.org: https://pypi.org/project/python-magic/

To create credentials for a google api desktop application, follow the instructions given by google: https://developers.google.com/workspace/guides/create-credentials

General usage information

  1. Download the script.

  2. Install the Dependencies.

  3. Run the script. (python3 downloadandcompare.py)

  4. (optional). If this is your first time running the sample, the sample opens a new window prompting you to authorize access to your data:

    • If you are not already signed in to your Google account, you are prompted to sign in. If you are signed in to multiple Google accounts, you are asked to select one account to use for the authorization. Note: Authorization information is stored on the file system, so subsequent executions don't prompt for authorization.
    • Click Accept. The app is authorized to access your data.

About

A script that cleans up PDF's in a folder by searching for them in google drive and uploading them if not available

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages