Skip to main content

solvedrive

solvedrive is an async Python client for Google Drive. It wraps the Drive REST API in a few small classes (GDrive, Drive, File, Folder, and their collections), so you can upload and download files, search across My Drive and shared drives, export Google Docs, organize with folders, and share, all with plain method calls.

It is built on fastgws for OAuth and API access, and runs every call asynchronously, so you await each one. Searches come back with the useful fields (name, mimeType, size, parents, trashed, webViewLink) already populated in one request, and reprs render file names as links that open the file in Drive.

Installation

Install latest from pypi

$ pip install solvedrive

How to use

solvedrive signs in with OAuth 2.0 through fastgws, which expects an OAuth client secret at ~/.config/fastgws/credentials.json. The fastgws docs cover how to create that file from a Google Cloud project. The first connection opens a browser to authorize the scopes you asked for, then caches the token so later runs don’t prompt again.

Create a GDrive client with the scopes you need: readonly to search and download, file to also manage the files your app created, or full for everything. about() returns the signed-in account, with the address on its email attribute.

gd = await GDrive.init(scopes='full')
about = await gd.about()
about.email
'nc@answer.ai'

Uploading

upload sends bytes or a local path to Drive, returning the new File. Its repr shows the essentials, with the name linking to the file in Drive.

f = await gd.upload(data=b'hello from solvedrive!', name='solvedrive_hello.txt')
f

File(1X0jjggHSWBTQbxaLxtsSNqcDW9uIJpQh: solvedrive_hello.txt (text/plain, 22B) 2026-07-28T21:08:32.734Z)

Searching

search_files takes Drive’s own query syntax, the same operators the Drive search box uses, and searches every drive you can see: My Drive, files shared with you, and all shared drives. Results are a Files collection with a table repr.

fs = await gd.search_files("name = 'solvedrive_hello.txt' and trashed=false")
fs
id name type size modified
1X0jjggHSWBTQbxaLxtsSNqcDW9uIJpQh solvedrive_hello.txt text/plain 22B 2026-07-28

Downloading

download returns a file’s bytes. Google-native files (Docs, Sheets, Slides) have no bytes of their own, so they are exported to a regular format instead: docx for Docs, xlsx for Sheets, pptx for Slides, or any supported mime= you ask for.

await f.download()
b'hello from solvedrive!'

Folders

A folder is a file with a special mimeType. create_folder makes one, move puts files in it, and ls lists what it holds.

folder = await gd.create_folder('solvedrive demo')
await f.move(folder)
await folder.ls()
id name type size modified
1X0jjggHSWBTQbxaLxtsSNqcDW9uIJpQh solvedrive_hello.txt text/plain 22B 2026-07-28

Drives

Every file lives in a drive: your My Drive, or a shared drive owned by an organization. list_drives returns them as a Drives table, and each Drive knows your role on it and scopes search_files to its contents. drive.root is an ordinary Folder, so uploading into and listing a shared drive works like any folder, and every file method sends supportsAllDrives, so a File behaves the same wherever it lives.

ds = await gd.list_drives()
ds[0]

Drive(root: My Drive, owner)

Sharing

share grants access, either to an email address or to anyone with the link when none is given. permissions lists the current grants, and unshare revokes one.

p = await f.share()
await f.permissions
[{'id': 'anyoneWithLink', 'type': 'anyone', 'role': 'reader'}, {'id': '12635610242443046038', 'type': 'user', 'emailAddress': 'nc@answer.ai', 'role': 'owner'}]

There’s more in solvedrive.core: working inside shared drives, renaming and copying, trash versus permanent deletion, and operating on a whole Files collection at once through Google’s batch protocol. See the docs for the full tour.

Use as an LLM skill

solvedrive registers a pyskills skill, so an LLM host such as solveit can load it and use the safe API (searching, downloading, uploading, creating folders) by default. Renaming, moving, trash, deletion, and sharing are documented in the skill but are not enabled, so you turn them on when a task needs them.

Download files

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

Source Distribution

solvedrive-0.1.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solvedrive-0.1.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file solvedrive-0.1.0.tar.gz.

File metadata

  • Download URL: solvedrive-0.1.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for solvedrive-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a226040ef33536aaf4c947d95a5a26837858654a63778e20b45aa06a8beca4e1
MD5 3b09a42612127b3856e131f375d28034
BLAKE2b-256 d72557d3a9c17fbdc4af5d5f4c3bd7d77dfe5198125908a65987a9305ffe1f2a

See more details on using hashes here.

File details

Details for the file solvedrive-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: solvedrive-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for solvedrive-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 445e56afa2eca25183f78910dcceb9e842a9e9dc1f3b51765077159d5141ee03
MD5 59516d1802cc071c713f729a55fd48e6
BLAKE2b-256 4f8b6369a38e3a5f4fab4bc7827786a38e765d5f2a00617caab30b0bf7c0664e

See more details on using hashes here.

Supported by

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