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 Leash-hosted integrations and MCP-backed tools.

This SDK talks to the Leash platform proxy, which handles:

  • OAuth token storage
  • provider routing
  • MCP execution
  • app env lookup

Install

pip install leash-sdk

Quick Start

from leash import LeashIntegrations

client = LeashIntegrations(
    auth_token="your-platform-jwt",
    api_key="optional-app-api-key",
)

messages = client.gmail.list_messages(max_results=10)
events = client.calendar.list_events(time_min="2026-04-01T00:00:00Z")
files = client.drive.list_files(max_results=10)

env = client.get_env()
connected = client.is_connected("gmail")

Default Platform URL

The default platform base URL is:

  • https://leash.build

Requests are sent to routes such as:

  • https://leash.build/api/integrations/{provider}/{action}
  • https://leash.build/api/apps/env
  • https://leash.build/api/mcp/run

Supported Client Features

  • Gmail actions
  • Google Calendar actions
  • Google Drive actions
  • generic provider calls
  • custom integration proxy calls
  • connection status lookup
  • connect URL generation
  • app env fetch and caching
  • MCP package execution via the platform

Example

from leash import LeashIntegrations

client = LeashIntegrations(auth_token="your-platform-jwt")

if not client.is_connected("gmail"):
    print(client.get_connect_url("gmail", return_url="https://myapp.example.com/settings"))
else:
    print(client.gmail.list_messages(max_results=5))

Notes

  • auth_token should be a valid Leash platform JWT.
  • api_key is optional, but useful for app-scoped env access and service-to-service usage.
  • The SDK does not manage provider OAuth itself. It delegates that to the Leash platform.

License

Apache-2.0

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.1.tar.gz (15.5 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.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: leash_sdk-0.2.1.tar.gz
  • Upload date:
  • Size: 15.5 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.1.tar.gz
Algorithm Hash digest
SHA256 961106574b98f5c48e4c6c38254858c80e6e23aaaeb65da8c183fe864cd192d1
MD5 2966c9c96fdd0676ad48e7d99a664cbc
BLAKE2b-256 39c988929a1e548abd6af185dee77451101cd4827f5cdea90b30f393c3bb2fc5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: leash_sdk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1be7fe867dd416de521f98bef6dbf83d28b7cb6aacb727107d237524306ed494
MD5 d175fb7ef80888fa8d96952f8f91b3f7
BLAKE2b-256 a16581cc3f04631457e5bc3a6dc140b7d45a37b086260b69cc1805644818acb7

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