Skip to main content

python interface of the google apps service

Project description

Build Google Workspace add-ons in Python 🐍 !!!

***

Build Status Deployment Code Quality License Contribution PR


📝 Table of Contents

❗ What is GAPPS?

GAPPS is a library that allows developers to easily and flexibly build add-ons for Google Workspace using Python 🐍. With GAPPS, you can create powerful tools and integrations for Gmail, Google Chat, Calendar, Sheets, Drive, Docs and other Google Workspace apps, that can streamline your workflow and automate common tasks.

⚡ Key Features

  • A simple and easy-to-use API for building Google Workspace add-ons.
  • Flexible interface that can be used for a variety of use cases.
  • Built-in support for Gmail, Google Calendar, Google Drive and other Google Workspace apps.
  • Well-documented, well-maintained codebase and easy to contribute.

🏁 Getting Started

🚜 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 .

⚙️ CardService: Choose your coding style!

GAPPS allows you to build extensions by following your favorite coding style

Appscript Style

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()

Pythonic Style

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()

⛏️ Card Builder

The online Card builder can help you prototype your app's interface.

🚀 Demos

Check out the examples folder for sample codes. It contains the following examples:

  • cats.py: Mirror of google Cats example. Compatible with Gmail, Google Calendar, Google Drive, Google Docs and Google sheets
  • simple_demo.py: minimalistic example to show how to build a basic card.
  • card_builder.py: This example show how to reproduce all the templates from the online Card builder. It can help you prototype your app's interface.

💬 Tutorials

Coming soon...

📄 Methods reference

CardService: 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

✅ 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.0rc4.tar.gz (250.1 kB view details)

Uploaded Source

Built Distribution

gapps-0.1.0rc4-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file gapps-0.1.0rc4.tar.gz.

File metadata

  • Download URL: gapps-0.1.0rc4.tar.gz
  • Upload date:
  • Size: 250.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for gapps-0.1.0rc4.tar.gz
Algorithm Hash digest
SHA256 eb1cedf9e89879b7d8436c7395507b7b4086f1ed0142b1c1ac3641615f72b4cf
MD5 8bf303f20ddce39a605f3104ba0fb33a
BLAKE2b-256 f880c25dade53a212c7b7e3f61e64d8348a5af8f7f31c87cc05505e9122f2e65

See more details on using hashes here.

Provenance

File details

Details for the file gapps-0.1.0rc4-py3-none-any.whl.

File metadata

  • Download URL: gapps-0.1.0rc4-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for gapps-0.1.0rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 1ee189f553439c1ab7be33f6af39395828ccc2b33efaa91f252953bf27255c62
MD5 b9341475ea750644b3e6714e1d00828b
BLAKE2b-256 fbf4d1bd949b19b071b4512327a36ad02a46fe090f091e1f26a98778ac7911b9

See more details on using hashes here.

Provenance

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