{"library":"pydrive","title":"PyDrive","description":"PyDrive is a Python wrapper library for the Google Drive API that simplifies common tasks like authentication, file upload, download, and management. The current version is 1.3.1. However, the original PyDrive project is deprecated and no longer maintained. Its last release was in 2016, and the GitHub repository was archived in July 2021. Users are strongly encouraged to consider `PyDrive2` (pypi.org/project/PyDrive2), an actively maintained fork, for ongoing development and support.","language":"python","status":"abandoned","last_verified":"Sat May 16","install":{"commands":["pip install pydrive"],"cli":null},"imports":["from pydrive.auth import GoogleAuth","from pydrive.drive import GoogleDrive"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pydrive.auth import GoogleAuth\nfrom pydrive.drive import GoogleDrive\nimport os\n\n# --- Pre-requisites for Quickstart ---\n# 1. Go to Google API Console (console.developers.google.com/apis/credentials)\n# 2. Create a new project or select an existing one.\n# 3. Enable the 'Google Drive API'.\n# 4. Create 'OAuth client ID' credentials:\n#    - Application type: 'Web application'\n#    - Authorized JavaScript origins: http://localhost:8080\n#    - Authorized redirect URIs: http://localhost:8080/\n# 5. Download the client configuration JSON file and rename it to 'client_secrets.json'.\n# 6. Place 'client_secrets.json' in the same directory as this script.\n# -------------------------------------\n\ngauth = GoogleAuth()\n\n# Try to load saved client credentials (e.g., from 'credentials.json' generated previously)\ngauth.LoadCredentials()\n\nif gauth.credentials is None:\n    # Authenticate if credentials are not found\n    print(\"Performing initial authentication via local webserver...\")\n    gauth.LocalWebserverAuth() # Creates local webserver and auto handles authentication.\nelif gauth.access_token_expired:\n    # Refresh them if expired\n    print(\"Refreshing expired access token...\")\n    gauth.Refresh()\nelse:\n    # Initialize the saved credentials\n    print(\"Using existing credentials.\")\n    gauth.Authorize()\n\n# Save the current credentials to a file for future use\ngauth.SaveCredentials()\n\ndrive = GoogleDrive(gauth)\n\n# --- Create and Upload a File ---\nfile_title = \"PyDrive_Registry_Test_File.txt\"\nfile_content = \"This is a test file uploaded using PyDrive from the registry quickstart. Hello, Google Drive!\"\n\n# Create GoogleDriveFile instance with metadata.\nfile_metadata = {'title': file_title, 'mimeType': 'text/plain'}\nfile1 = drive.CreateFile(file_metadata)\nfile1.SetContentString(file_content) # Set content from a string\nfile1.Upload() # Upload the file to Google Drive\nprint(f\"\\nSuccessfully uploaded file: '{file1['title']}' (ID: {file1['id']})\")\n\n# --- List Files (optional, for demonstration) ---\nprint(f\"\\nSearching for file with title '{file_title}'...\")\nfile_list = drive.ListFile({'q': f\"'me' in owners and title = '{file_title}' and trashed = false\"}).GetList()\nif file_list:\n    print(f\"Found {len(file_list)} file(s) with title '{file_title}':\")\n    for file in file_list:\n        print(f\" - Title: {file['title']}, ID: {file['id']}, MimeType: {file['mimeType']}\")\nelse:\n    print(f\"No file found with title '{file_title}'.\")","lang":"python","description":"This quickstart demonstrates how to authenticate with Google Drive using PyDrive's `LocalWebserverAuth()` flow and then create and upload a simple text file. It also includes basic error handling for token expiration and shows how to list files. Ensure you have a `client_secrets.json` file from the Google API Console in your script's directory before running.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"1.3.1","pypi_latest":"1.3.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":6.5,"avg_import_s":1.28,"wheel_type":"sdist"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.05,"mem_mb":20.9,"disk_size":"149.7M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":6.2,"import_time_s":0.82,"mem_mb":20.9,"disk_size":"151M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.53,"mem_mb":23.3,"disk_size":"154.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":6,"import_time_s":1.34,"mem_mb":23.2,"disk_size":"156M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.51,"mem_mb":22.9,"disk_size":"144.4M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":6.6,"import_time_s":1.63,"mem_mb":22.9,"disk_size":"146M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.5,"mem_mb":24,"disk_size":"144.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":6.6,"import_time_s":1.56,"mem_mb":24,"disk_size":"146M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":0.96,"mem_mb":20.8,"disk_size":"149.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pydrive","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":7.1,"import_time_s":0.87,"mem_mb":20.8,"disk_size":"151M"}]}}