User friendly wrapper for Google APIs
Project description
gwrappy
User friendly wrapper for Google APIs.
Features
- Easily connect to the following Google APIs (more to come eventually)
BigQuery
Cloud Storage
Drive
Gmail
# BigQuery
from gwrappy.bigquery import BigqueryUtility
bq_obj = BigqueryUtility()
results = bq_obj.sync_query('my_project', 'SELECT * FROM [foo.bar]')
# Cloud Storage
from gwrappy.storage import GcsUtility
gcs_obj = GcsUtility()
gcs_obj.download_object('bucket_name', 'object_name', 'path/to/write')
gcs_obj.upload_object('bucket_name', 'object_name', 'path/to/read')
# Drive
from gwrappy.drive import DriveUtility
drive_obj = DriveUtility(json_credentials_path, client_id)
drive_obj.download_object('file_id', 'path/to/write')
drive_obj.upload_file('path/to/read')
# Gmail
from gwrappy.gmail import GmailUtility
gmail_obj = GmailUtility(json_credentials_path, client_id)
gmail_obj.send_email(sender='Daniel Poon', to=['recipient_1@xx.com', 'recipient_2@yy.com'], subject='Hello World!', message_text='My First Email')
Installation
$ pip install gwrappy
History
0.1.6 (2016-09-08)
- Added more utilities
utils.month_range: Chunk dates into months.
utils.simple_mail: Send basic emails for alerts or testing. Note: For greater security and flexibility, do still use the gmail functionality within this package.
utils.StringLogger: Simply wrapper for logging with a string handler and convenience functions for retrieving logs as a string.
Added dateutil as a dependency
0.1.5 (2016-08-30)
list methods now return a generator for memory efficiency
- BigQuery:
list_jobs takes 2 new args projection and earliest_date
Documentation updates
0.1.4 (2016-08-29)
gwrappy.errors no longer imports service specific error objects. To access JobError, import it from gwrappy.bigquery.errors
simple date range generator function added to gwrappy.utils
0.1.3 (2016-08-23)
- BigQuery:
- JobResponse now only sets time_taken if data is available.
Fixed bug that raised KeyError when wait_finish=False, since endTime was unavailable in the API response.
poll_resp_list returns JobReponse objects. Also propagates ‘description’ attribute if available.
0.1.2 (2016-08-19)
Bug Fixes
Documentation updates
0.1.1 (2016-08-16)
Completed docstrings and amendments to documentation
Added list_to_html under gwrappy.gmail.utils
Added tabulate as a dependency
0.1.0 (2016-08-15)
New and improved version of https://github.com/danielpoonwj/gcloud_custom_utilities
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.