Skip to main content

Leash platform SDK - access Gmail, Calendar, Drive and more from deployed apps

Project description

Leash SDK (Python)

Python SDK for accessing platform integrations (Gmail, Google Calendar, Google Drive) from apps deployed on Leash.

Install

pip install leash-sdk

Usage

from leash import LeashIntegrations

# Get the auth token from the leash-auth cookie (e.g. in Flask/Django)
integrations = LeashIntegrations(auth_token="your-jwt-token")

# Gmail
emails = integrations.gmail.list_messages(max_results=10)
integrations.gmail.send_message(to="user@example.com", subject="Hello", body="World")

# Calendar
events = integrations.calendar.list_events(time_min="2026-04-01T00:00:00Z")
integrations.calendar.create_event(
    summary="Meeting",
    start="2026-04-10T10:00:00Z",
    end="2026-04-10T11:00:00Z",
)

# Drive
files = integrations.drive.list_files(max_results=10)
integrations.drive.upload_file(name="notes.txt", content="hello", mime_type="text/plain")

How it works

The SDK calls the Leash platform proxy at https://api.leash.build/api/integrations/{provider}/{action}. The platform handles all OAuth token management -- the SDK just passes the user's auth token and makes typed API calls.

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

leash_sdk-0.2.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

leash_sdk-0.2.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file leash_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: leash_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for leash_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b62763ceec7ee95fe314c3b9dbd06afb21b93a5aeecb0c6705c0f12077f35835
MD5 db44e57580206c320c31ab0847f4e18b
BLAKE2b-256 1881a19e7bad0eca8517828e6ba1684f303559a951708e7adde8b25887d0d70e

See more details on using hashes here.

File details

Details for the file leash_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: leash_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for leash_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d769da3adc27db2ee67ebc32d02b14a4535ddedee744913a2cac22735a10323
MD5 883e5b2bd3a26aff631fc6e7708fd753
BLAKE2b-256 340227d16e86cda5946ab49d4700ddb59a8eb007e2284346aaf80cb965137dda

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