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 (Drive, File, Folder, and the Files collection), so you can upload and download files, search with Drive’s query syntax, 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 Drive 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.

drive = await Drive.init(scopes='full')
about = await drive.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 drive.upload(data=b'hello from solvedrive!', name='solvedrive_hello.txt')
f

File(1q7Ki1z40Q2Ec5Xl9eEHMDwMfx4lwGw3Q: solvedrive_hello.txt (text/plain, 22B) 2026-07-28T13:48:55.654Z)

Searching

search_files takes Drive’s own query syntax, the same operators the Drive search box uses, and returns a Files collection with a table repr.

fs = await drive.search_files("name = 'solvedrive_hello.txt' and trashed=false")
fs
id name type size modified
1q7Ki1z40Q2Ec5Xl9eEHMDwMfx4lwGw3Q 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 drive.create_folder('solvedrive demo')
await f.move(folder)
await folder.ls()
id name type size modified
1q7Ki1z40Q2Ec5Xl9eEHMDwMfx4lwGw3Q solvedrive_hello.txt text/plain 22B 2026-07-28

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: 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.0.1.tar.gz (15.7 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.0.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for solvedrive-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2e674dff835859462227ffc3321e0d01468764617ade23a175d8203755295bd4
MD5 07c6aa25598fc51c253c9381bf38c594
BLAKE2b-256 203e6861a206b584686fe15f206ea076c251641af11c7ffd46a996ab8ac4f8fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solvedrive-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe3d0cddd8982e2a4c8f2234be6ddfe973b1aa6155ced4dfd3ad439b45963f8e
MD5 dff5baa8eac586588a46397afa4f898f
BLAKE2b-256 000178091338eb2e3be12da16e2f803a30b4618ce4eb12cc1bb717538032229b

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