-
Installation:
Install the DriveX library from PyPI or GitHub.
pip install DriveX
or
git clone https://github.com/Sepehr0Day/DriveX.git
-
Obtain Google Drive API Credentials:
- Create a project in the Google Cloud Console.
- Enable the Google Drive API for your project.
- Create OAuth client ID credentials.
- Download the credentials JSON file.
-
Code:
from DriveX import ServiceBuilder, GoogleDriveAPI # Path to the credentials JSON file credentials_path = 'credentials.json' # Path to save token token_path = 'Resources/Authenticator' # Name for the token file token_name = 'token' # Create ServiceBuilder object service_builder = ServiceBuilder(credentials_path=credentials_path, token_path=token_path, token_name=token_name) try: # Build service drive_service = service_builder.build_service() # Connect to Google Drive API drive_api = GoogleDriveAPI(service=drive_service, credentials=credentials_path) print("You Successfully Connected To Your Google Drive Account!") except Exception as e: print(f"An error occurred: {e}")
Make sure to replace
'credentials.json'
with the path to your credentials JSON file obtained from the Google Cloud Console.
For more information and advanced usage, refer to the DriveX documentation.
This project is licensed under the MIT License. See the LICENSE file for details.
- Telegram: t.me/Sepehr0Day
Feel free to contribute to the project or report any issues on the GitHub repository!