python interface of the google apps service
Project description
GAPPS
Your opensource library for helping you to
Build Google Workspace add-ons in Python 🐍 !!!
***
Google Workspace add-ons are the extensions that can be found in the side panel of most Google apps (Gmail, Google Drive, Sheets, Docs, Slides, etc), unlike the more complex Editor add-ons that can be found in the "Add-ons" tab of Google Sheets, Docs and Slides.
Addons | App Script Styple | Pythonic Style |
---|---|---|
Status | Response |
def create_cat_card(text):
# Use the "Cat as a service" API to get the cat image. Add a "time" URL
# parameter to act as a cache buster.
now = datetime.now()
caption = text.replace('/', ' ')
imageUrl = f'https://cataas.com/cat/says/{caption}?time={now.timestamp()}'
image = CardService.Image(image_url=imageUrl, alt_text='Meow')
action = CardService.Action(
function_name='on_change_cat',
parameters={'text': text, 'is_homepage': str(is_homepage)})
button = CardService.TextButton(
text='Change cat', action=action,
text_button_style=CardService.TextButtonStyle.FILLED)
button_set = CardService.ButtonSet(button=button)
section = CardService.CardSection(widget=[image, button_set])
card = CardService.CardBuilder(section=section)
return card.build()
|
def create_cat_card(text):
# Use the "Cat as a service" API to get the cat image. Add a "time" URL
# parameter to act as a cache buster.
now = datetime.now()
caption = text.replace('/', ' ')
imageUrl = f'https://cataas.com/cat/says/{caption}?time={now.timestamp()}'
image = CardService.Image(image_url=imageUrl, alt_text='Meow')
action = CardService.Action(
function_name='on_change_cat',
parameters={'text': text, 'is_homepage': str(is_homepage)})
button = CardService.TextButton(
text='Change cat', action=action,
text_button_style=CardService.TextButtonStyle.FILLED)
button_set = CardService.ButtonSet(button=button)
section = CardService.CardSection(widget=[image, button_set])
card = CardService.CardBuilder(section=section)
return card.build()
|
400 |
Markdown here. (Blank lines needed before and after!) |
Getting Started
Deployment | |
Build Status | |
Metrics | |
License | |
Community |
Installation
This client is hosted at PyPi under the name gapps, to install it, simply run
pip install gapps
or install dev version:
git clone https://github.com/skoudoro/gapps.git
pip install -e .
Method reference
For the complete reference, visit the official Google Workspace Add Ons API reference.
Notes
We still need to handle some widgets/builders but 90% of them are working correctly
we are currently updating the project to handle the new V2 released last summer 2022.
Tests
- Step 1: Install pytest
pip install pytest
- Step 2: Run the tests
pytest -svv gapps
Contribute
We love contributions!
You've discovered a bug or something else you want to change - excellent! Create an issue!
You've worked out a way to fix it – even better! Submit a Pull Request!
Start with the contributing guide!
License
Project under MIT license, more information here
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.