Skip to main content

DriveX library to connect and work with Google Drive!

Project description

DriveX

Connect to Google Drive

  1. Installation:

    Install the DriveX library from PyPI or GitHub.

    pip install DriveX
    

    or

    git clone https://github.com/Sepehr0Day/DriveX.git
    
  2. 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.
  3. 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.

Documentation DriveX:

For more information and advanced usage, refer to the DriveX documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Developer


Feel free to contribute to the project or report any issues on the GitHub repository!

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

DriveX-0.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

DriveX-0.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file DriveX-0.1.tar.gz.

File metadata

  • Download URL: DriveX-0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for DriveX-0.1.tar.gz
Algorithm Hash digest
SHA256 206a6cac6934679558e42a8e91ee4c4435d6db9fa666a5ad215f430def188deb
MD5 11e3ea4bca15931abaa4a1b85c0a1288
BLAKE2b-256 1a650e354971a5f96968c5a7a763fb4ed82a3ce0cb0cc35bb06d4303f8bd44b1

See more details on using hashes here.

File details

Details for the file DriveX-0.1-py3-none-any.whl.

File metadata

  • Download URL: DriveX-0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for DriveX-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef2b4b08e2ad53f5529d13213bcbe3362a8465efa689ee058d60d91dbc304f1a
MD5 d4edfc4ebec7d328cbcaadc883ae59f9
BLAKE2b-256 8728d10928c35fe8d33b21abf00bbda66d8b09510e1d8797ea7e3dc15100af27

See more details on using hashes here.

Supported by

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