Skip to content

slim0/gdrive-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gsuite-api

Bunch of functions that allows you to interact with GSuite API.

Requirements

Before using the API, you'll need to:

  • Create a Google service account. https://cloud.google.com/compute/docs/access/service-accounts
  • Enable and configure Google API.
  • Download the JSON credentials file of your service account, secure it and enter the path in the "SERVICE_ACCOUNT_CREDENTIALS_FILE" variable (services.py file)
  • Install required libraries in your environment : pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
  • Enable domain-wide delegation for the service account so it can access every users datas in your domain.

Please take a look at these links, they will help you with this:

How to use it

Once everything has been correctly configured:

In your environment, launch a python console, and, for example:

#!/usr/bin/env python
# coding: utf8
from services import *
from drive import *
from sheets import *

scopes = ["https://www.googleapis.com/auth/drive", ]
api = "drive"

service = get_service(scopes, api, user_email=None)
get_files(service)
# Should return the first the 100 first files of your service account 

About

Bunch of functions that allows you to interact with GSuite API.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages