Skip to main content

A Simplified Google Drive API.

Project description

📦️ EGDrive

A simplified Google Drive API wrapper for Python.

EGDrive is a built on top of PyDrive2, it simplifies managment of Google Drive using Python, it has a high level interface emulating Linux file management commands in an intuitive way.

Installation

Install EGDrive with pip

    pip install EGDrive

📌 Features

  • Intuitive Unix-like commands (ls, mkdir, rm ...) to manage Google Drive
  • Uses Unix path's format, no more Google Drive ID's headaches.
  • Built on top of PyDrive2, access GoogleDrive and GoogleAuth instances for more options.
  • Lightweight.

🚀 Usage/Examples

Authentication with Google Drive

Create a new project in Google's APIs Console, for that follow this guide in here. To make the authentication automatic follow this guide.

Usage Examples

Initiate an EGDrive instance.

from EGDrive import EGDrive

gdrive = EGDrive()

List files

files = [file['title'] for file in gdrive.ls('root')]
for file in files:
    print(file)

Create a directory

gdrive.mkdir("/Books")

Create even more directories

gdrive.mkdir("/Books/Science")
gdrive.mkdir("/Books/Litterature")
gdrive.mkdir("/Books/Science/Programming/JAVA")
gdrive.mkdir("/Books/Science/Programming/Python/3/")

Remove files and directories

# move to Trash
gdrive.rm("/Books/Science/Programming/JAVA")
# delete permanently
gdrive.rm("/Books/Litterature", permanently=True)

Download a file

gdrive.download("/Books/Science/physics.pdf", "/home/user/Downloads/physics.pdf")

Upload a file

gdrive.upload("/home/user/Videos/mrbean.mp4", "/Videos/mrbean.mp4")

Check if a file exists

gdrive.exists("/path/to/file")

Create an empty file

gdrive.touch("/Documents/empty.txt")

Get access to PyDrive2 GoogleDrive and GoogleAuth instances

gdrive.drive # GoogleDrive instance
gdrive.gauth # GoogleAuth instance

🔧 Contributing

Contributions are always welcome!

Project details


Download files

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

Source Distribution

EGDrive-0.1.1.tar.gz (8.8 kB view details)

Uploaded Source

File details

Details for the file EGDrive-0.1.1.tar.gz.

File metadata

  • Download URL: EGDrive-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for EGDrive-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d3cfb7faa63f0d15802b26f7f726908452476a97421095ecbb3e09a43e25bacc
MD5 f4525addab9c4d4b24b80541315469b1
BLAKE2b-256 a9af0bef43321b8392894e921841119d40c09e6cb9eb4d7d87d03dc81b6825de

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