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/envhttps://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_tokenshould be a valid Leash platform JWT.api_keyis 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.3.0.tar.gz
(18.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
leash_sdk-0.3.0-py3-none-any.whl
(14.4 kB
view details)
File details
Details for the file leash_sdk-0.3.0.tar.gz.
File metadata
- Download URL: leash_sdk-0.3.0.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11b95db09641df23fc4b8d5abe3d561f49859678d7e2f8837949f98670d530d3
|
|
| MD5 |
6cb609b7ad225a64c1d99861c8378be3
|
|
| BLAKE2b-256 |
aeb13360151856f05e976c3c304219c0f1c1040a4e8ba565959d20d661ca55b4
|
File details
Details for the file leash_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: leash_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f372790f1c9c25322d18107899380587bb7ee33d3088f0b0d80fbf96dcdc1273
|
|
| MD5 |
b345a95da66b3d2ad872d9176e6d5740
|
|
| BLAKE2b-256 |
dc10d5ceb04397706ecdbc36fbfe0506a63cd2a1caf8012a013b7ce029d404ab
|