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.

Release files for solvedrive 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solvedrive 0.1.0
File Size Uploaded
solvedrive-0.1.0.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for solvedrive 0.1.0
File Interpreter ABI Platform
solvedrive-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.5 kB

Release files / solvedrive-0.1.0.tar.gz

Download URL solvedrive-0.1.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a226040ef33536aaf4c947d95a5a26837858654a63778e20b45aa06a8beca4e1
BLAKE2b-256 checksum
How to use checksums
d72557d3a9c17fbdc4af5d5f4c3bd7d77dfe5198125908a65987a9305ffe1f2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / solvedrive-0.1.0-py3-none-any.whl

Download URL solvedrive-0.1.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
445e56afa2eca25183f78910dcceb9e842a9e9dc1f3b51765077159d5141ee03
BLAKE2b-256 checksum
How to use checksums
4f8b6369a38e3a5f4fab4bc7827786a38e765d5f2a00617caab30b0bf7c0664e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page