Skip to main content

helper package to interface with required google api services. It is completely independent package for generic usage.

example-usage:

from vedavaapi.google_helper.gsheets import GSheets
from vedavaapi.google_helper.gdrive import GDrive

credentials_file_path = 'path/to/credentials.json'
scopes = ['https://www.googleapis.com/auth/drive.readonly', 'https://www.googleapis.com/auth/spreadsheets.readonly']

#get instance of GSheets helper class, from our credentials.
gsheets_helper = GSheets.from_creds_file(credentials_file_path, scopes)

#now use it to access data in our required valuesFormat with header row mapping, etc.
#we can provide only desired customized parameters in 'pargs' dictionary parameter. if no custom 'fields' are choosen in pargs, then all fields will be returned. if no range mentioned, all sheet values will be returned.
vakyas_sheet_values, statuscode = gsheets_helper.sheet_values_for(spreadsheet_id='someGooGleSheetId',sheet_id='Vakyas', pargs={'idType':'title', 'valuesFormat':'maps', 'fields':['Vakya_id', 'Tantrayukti_tag', 'Vakya'], 'range':'1:27'} )

#get instance of GDrive helper class, from our credentials.
gdrive_helper = GDrive.from_creds_file(credentials_file, scopes)

#now use it to retrieve spreadsheet files details in a google drive folder
list_of_files_in_folder, status_code = gdrive_helper.list_of_files_in_folder(folder_id='bJUyfjaitxkzsl_jagkkahajru2acd', mime_types=['application/vnd.google-apps.spreadsheet'], additional_pargs={'orderBy':'recency'})

above code just passes a credentials.json file and, get a GSheets/GDrive object. with these helper objects we query sheets/drive, etc, with their methods. But if we don't have credentials.json file(it represents owner's authorisation grant to our application), then we have to generate one from our application's client_secret.json file we get from google api console.(this client_secret.json is like id of our app.). in this case resource user, and application owner is same. we have to grant our app permission to access our files. for that fallow below. once credentials.json is there, no need of this.

from vedavaapi.google_helper.oauth import Authorizer

authorizer = Authorizer(client_secret_path='path/to/client_secret.json', credentials_storage_path='path/to/credentials.json', scopes=['https://www.googleapis.com/auth/drive.readonly', 'https://www.googleapis.com/auth/spreadsheets.readonly'])

authorizer.authorize() #this will redirect us to web browser, and after completion of authorisation credentials will be stored at given path. we can use these credentials and start using helper packages like above.

Download files

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

Source Distribution

google-services-helper-1.0.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

google_services_helper-1.0.0-py3.6.egg (25.9 kB view details)

Uploaded Egg

google_services_helper-1.0.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

google_services_helper-1.0.0-py2.7.egg (25.3 kB view details)

Uploaded Egg

google_services_helper-1.0.0-py2-none-any.whl (12.1 kB view details)

Uploaded Python 2

File details

Details for the file google-services-helper-1.0.0.tar.gz.

File metadata

  • Download URL: google-services-helper-1.0.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for google-services-helper-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a9ac782b74607b9c09290c88cde243f41e973def734304ffa198605981c68a45
MD5 7518f354ef188db1f0721fb45e1b4e21
BLAKE2b-256 814ba719b457caaad7db90b82ffff062485b7b29e908222fabf858f4b36044d3

See more details on using hashes here.

File details

Details for the file google_services_helper-1.0.0-py3.6.egg.

File metadata

  • Download URL: google_services_helper-1.0.0-py3.6.egg
  • Upload date:
  • Size: 25.9 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for google_services_helper-1.0.0-py3.6.egg
Algorithm Hash digest
SHA256 ec4b32ec844e72d286c5689453d0b031514012edceb6c4d0f37b37e9f3cc427f
MD5 db0de4c26f420e79bbbad414e589bfd0
BLAKE2b-256 8bcc1a91515abbe1ded27f3de5f4e47b9a0063ace26d48f758e9d44848f843bd

See more details on using hashes here.

File details

Details for the file google_services_helper-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: google_services_helper-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for google_services_helper-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78a4d4e04454334b32702fb2f1ccd02e348be051328002d4b6fd55f8075e4feb
MD5 a99251b9205946ee3e13b71299e0f740
BLAKE2b-256 7318781f8b8c7f8d78f4172ed9644803135bab94fccce719a97666e3a72c7693

See more details on using hashes here.

File details

Details for the file google_services_helper-1.0.0-py2.7.egg.

File metadata

  • Download URL: google_services_helper-1.0.0-py2.7.egg
  • Upload date:
  • Size: 25.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for google_services_helper-1.0.0-py2.7.egg
Algorithm Hash digest
SHA256 845443939d30e41f178051e68da50e64456a353793dc3600a8ae4e637b7d4d9a
MD5 de96f655aee5020b2a9fdb17f8ae90d0
BLAKE2b-256 7c78fb7b2e0a959a7ec4ad699d28e33964437c5805cca3217c2d07c82e578f0e

See more details on using hashes here.

File details

Details for the file google_services_helper-1.0.0-py2-none-any.whl.

File metadata

  • Download URL: google_services_helper-1.0.0-py2-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for google_services_helper-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 980d664a2095cb8d293ef6b406dd66aa5a8b3fc9aa719ddc90e238b20bad35fc
MD5 0e79a410dd3f9124838b805ef7e61d69
BLAKE2b-256 fe7f8e2d9d3611c5456cb846e4d0879f5284c6b426ac9d9dbffae2182b85190c

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