This is a small cli application that integrates with Google Drive. The application is able to perform the following tasks:
- Authenticate the user using OAuth 2.0.
- List files in the user’s Google Drive.
- Upload a file to the user’s Google Drive.
- Download a file from the user’s Google Drive.
- Delete a file from the user’s Google Drive
Here's why:
- Allows the user to quickly manage their google drive from the terminal
- Improves efficiency by preventing the user from having to switch away from their terminal
To get a local copy up and running follow these simple example steps.
Install dependencies using the following methods.
- Git
- Python 3.10.7 or greater
- The pip package management tool
- A Google Cloud project.
- A Google account with Google Drive enabled.
- Clone the repo
git clone [email protected]:Jorgensonnj/google-ftp.git
- Install python packages
or
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
sudo pacman -S python-google-api-python-client python-google-auth-httplib2 python-google-auth-oauthlib
- Create Google Account with Google Drive API enabled
- Create Google Cloud Project
- Create and save credentials for a desktop application as a JSON file named
creds.json
, and move the file to your google-ftp project root directory
Here are some examples of the cli in use
- Listing all files
./gftp.py ls
- Uploading a file
./gftp.py ucp ~/test.docx
- Downloading a file
./gftp.py dcp "test.docx" ~/test.docx
- Removing a file
./gftp.py rm "test.docx"
How to test
- Navigate to project root directory
cd /path/to/google-ftp
- Run Tests
python3 -m test.tests
- The user is familiar with the command line and is able to execute the program
- The user is more comfortable giving a file name from their google drive than providing a file id
- The google drive contains only files and no folders
- The user is able to save files to their file system