Giter VIP home page Giter VIP logo

gauthlib's Introduction

GAuthLib

Python3

Created by https://github.com/robolague/ and https://github.com/edwinruizr

A python function library for accessing Google APIs (Admin SDK, Mail, and Calendar)

Download this repo and from the directory:

pip3 install -r requirements.txt

To set your passwords up, edit gauthlib and replace:

my_admin = '[email protected]' with your own admin user.

Project Setup:

https://console.cloud.google.com/projectcreate

Name the project anything you want, then go to:

https://console.cloud.google.com/apis/library?

Enable Gmail API and Admin SDK, Calendar API, Drive API, Sheets API

To enable a service account(required):

https://console.cloud.google.com/iam-admin/serviceaccounts/project

Service account user role for the service account. Get the service account name (will end in iam.gserviceaccount.com)

edit gauthlib and replace:

service_account = '[email protected]'

For the service account, download the JSON key and place it in the same directory as this file. Get the name of the key and edit gauthlib and replace:

json_file_name = 'myJSONkey.json'

Be sure to enable Site-Wide Delegation for the service account user. Open the JSON file and retrieve the 'client_id' and make a note of it.

Go to https://admin.google.com/ManageOauthClients

For your client_id, authorize the following scopes (or any subset you will need for the function(s) you want to use):

https://www.googleapis.com/auth/admin.directory.user,
https://www.googleapis.com/auth/admin.directory.group,
https://www.googleapis.com/auth/admin.directory.group.member,
https://www.googleapis.com/auth/admin.directory.group.member.readonly,
https://www.googleapis.com/auth/admin.directory.device.mobile,
https://www.googleapis.com/auth/admin.directory.userschema,
https://www.googleapis.com/auth/gmail.settings.basic,
https://www.googleapis.com/auth/gmail.settings.sharing,
https://www.googleapis.com/auth/admin.directory.user.security,
https://mail.google.com/,
https://www.googleapis.com/auth/calendar,
https://www.googleapis.com/auth/gmail.modify,
https://www.googleapis.com/auth/gmail.settings.basic,
https://www.googleapis.com/auth/gmail.settings.sharing,
https://www.googleapis.com/auth/spreadsheets.readonly,
https://www.googleapis.com/auth/drive,
https://www.googleapis.com/auth/drive.file,
https://www.googleapis.com/auth/drive.readonly,
https://www.googleapis.com/auth/spreadsheets,
https://www.googleapis.com/auth/spreadsheets.readonly,
https://www.googleapis.com/auth/admin.reports.audit.readonly,
https://www.googleapis.com/auth/admin.datatransfer,
https://www.googleapis.com/auth/admin.datatransfer.readonly,
https://www.googleapis.com/auth/admin.directory.device.chromeos,
https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly,
https://www.googleapis.com/auth/admin.directory.group.readonly,
https://www.googleapis.com/auth/admin.directory.user.readonly

API References:

https://developers.google.com/admin-sdk/directory/v1/reference/

https://developers.google.com/gmail/api/v1/reference/

https://developers.google.com/calendar/v3/reference/

https://developers.google.com/admin-sdk/data-transfer

https://developers.google.com/sheets/api/reference/rest/

https://developers.google.com/drive/api/v3/reference/

gauthlib's People

Contributors

robolague avatar tinder-robolague avatar

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.