Skip to main content

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 pypi gapps
Build Status
Metrics codacy gapps python
License MIT
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


Download files

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

Source Distribution

gapps-0.1.0rc3.tar.gz (234.4 kB view hashes)

Uploaded Source

Built Distribution

gapps-0.1.0rc3-py3-none-any.whl (19.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page