The Google Drive PDF Downloader is a Python utility designed to facilitate the download of PDF files stored in Google Drive. This project includes two scripts:
inFolder.py: Downloads all PDF files from a specified folder.subFold.py: Downloads PDF files from a parent folder containing multiple subfolders.
Before you begin, ensure you have the following:
- Python 3.x: Make sure Python is installed on your system. You can download it from python.org.
- Pip: Python package manager should be installed to manage dependencies.
- Google Drive API Access: You will need access to the Google Drive API to authenticate and download files.
- Install Required Libraries: Open your command line or terminal and run the following command to install the necessary libraries:
pip install PyDrive
To download the project files, clone the repository from GitHub. Open your terminal and execute:
git clone https://github.com/manoj-chavan-13/pdfDrive.gitThis command creates a directory named pdfDrive that contains all the necessary files for the project.
- Google Cloud Console: Go to the Google Cloud Console.
- Create a New Project: Click on "Select a project" and then "New Project".
- Enable Google Drive API: Navigate to APIs & Services > Library. Search for Google Drive API and enable it.
- Create Credentials: Go to APIs & Services > Credentials. Click on "Create Credentials" and select "OAuth client ID".
- Configure Consent Screen: Set up the consent screen as required.
- Download Client Secrets: After creating credentials, download the
client_secrets.jsonfile and place it in the same directory as your Python scripts.
- Open the
inFolder.pyscript in a text editor. - Locate the variable
folder_idand replace its value with the ID of the Google Drive folder from which you want to download PDFs. The folder ID is part of the URL when you open the folder in Google Drive (e.g.,https://drive.google.com/drive/folders/<folder_id>). - Run the script using:
python inFolder.py
- All PDF files within the specified folder will be downloaded to your current directory.
- Open the
subFold.pyscript in a text editor. - Find the variable
parent_folder_idand set its value to the ID of the parent folder containing multiple subfolders. - Execute the script with:
python subFold.py
- The script will download all PDF files located in the subfolders, maintaining the original folder structure in your local directory.
For a detailed explanation of the code, please check the following documents:
- For inFolder.py, see the documentation at
inFolderDoc.md. - For subFold.py, see the documentation at
subFoldDoc.md.
These documents provide an in-depth look at the implementation, logic, and functionalities of each script.
The Google Drive PDF Downloader project offers a simple yet effective solution for downloading PDF files from Google Drive. By following the provided steps, users can easily set up their environment, run the scripts, and access their desired PDF documents efficiently.
Whether you are downloading files from a single folder or multiple subfolders, this tool streamlines the process, saving you time and effort.
For any further questions or support, please refer to the project's GitHub repository or contact the project maintainer directly.