Giter Site home page Giter Site logo

drive_api's Introduction

drive_api

This Python program is used to interact with Google Drive using the Google Drive API. It allows you to initialize a service, get a folder ID by its name, and list all files in a specific folder.

Usage

  1. Pre-requisites
  1. Import the necessary classes from the drive_api module:
from drive_api import ServiceAccountDrive
ServiceAccountDriveInstance = ServiceAccountDrive()
  1. Initialize the Google Drive service:
cred = "path_to_your_credentials_file.json"
service, credentials = ServiceAccountDriveInstance.initialize_drive_service(creds=cred)

In this step, replace "path_to_your_credentials_file.json" with the path to your Google Drive API credentials file.

  1. Get the folder ID by its name:
folder_id = ServiceAccountDrive.get_folder_id_by_name("Folder Name")

Replace "Folder Name" with the name of the folder you're interested in.

  1. List all files in a specific folder:
files = ServiceAccountDrive.list_files_in_folder(folder_id)

Replace folder_id with the folder ID you got in the previous step.

  1. Download file from drive
ServiceAccountDrive.download_file_from_drive("file_id", "path/to/save")

Replace file_id with the file ID and replace path/to/save with saved path

drive_api's People

Contributors

saalimon avatar apwheele avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

saenanan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.