Skip to main content

truto-python-sdk

truto-python-sdk is a Python SDK to interact with the Truto API, a powerful integration platform for connecting multiple SaaS applications. The SDK mirrors the Truto REST API endpoints, which are documented in the Truto Postman Collection.

Run in Postman

Requires

Python 3.8+

Installation

Install the package via pip:

pip install truto-python-sdk

Usage

import asyncio
from truto_python_sdk import TrutoApi

truto_api = TrutoApi(token="<your_api_token>")

async def main():
    # Fetch all installed integrations for the environment
    installed_integrations = truto_api.environment_integrations.list()
    async for integration in installed_integrations:
        print(integration)

    # Fetch integrated accounts for a tenant
    integrated_accounts = truto_api.integrated_accounts.list(tenant_id="acme-1")
    print(await integrated_accounts.to_array())

    # Make a request to the unified API
    unified_cursor = truto_api.unified_api.list(
        "accounting",
        "accounts",
        {
            "integrated_account_id": "766cc1ee-6637-4aa1-a73e-a0c89ccc867c",
            "created_at": "2023-05-01T00:00:00.000Z",
        },
    )
    async for account in unified_cursor:
        print(account)

    unified_resource = await truto_api.unified_api.get(
        "accounting",
        "accounts",
        "1",
        {"integrated_account_id": "766cc1ee-6637-4aa1-a73e-a0c89ccc867c"},
    )
    print(unified_resource)

asyncio.run(main())

List Calls and Pagination

The SDK uses async iterators for list calls. This allows you to iterate through resources without manually handling pagination.

cursor = truto_api.unified_api.list(
    "ticketing",
    "tickets",
    {"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"},
)
async for ticket in cursor:
    print(ticket)

You can also call to_array() to auto-paginate and collect all resources:

tickets = await truto_api.unified_api.list(
    "ticketing",
    "tickets",
    {"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"},
).to_array()

Or fetch one page at a time with next_page():

page = await truto_api.unified_api.list(
    "ticketing",
    "tickets",
    {"integrated_account_id": "c54bc595-486e-4bbb-8c17-20810fa4a86c"},
).next_page()

Additional Endpoints

The SDK also includes endpoints for Custom API, MCP, Workflows, Workflow Runs, Alarms, Static Gates, Sandbox Integrated Accounts, and Webhooks. See full reference in ADVANCED_USAGE.md.

Contributing

We welcome contributions to improve truto-python-sdk. Please submit issues or pull requests on the GitHub repository.

License

MIT

Metadata

Release files for truto-python-sdk 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for truto-python-sdk 0.1.6
File Size Uploaded
truto_python_sdk-0.1.6.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for truto-python-sdk 0.1.6
File Interpreter ABI Platform
truto_python_sdk-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 35.0 kB

Release files / truto_python_sdk-0.1.6.tar.gz

Download URL truto_python_sdk-0.1.6.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6b446e274d611ad81ed35a7274601b0fe4ce734cce1d59418870b75784233bbe
BLAKE2b-256 checksum
How to use checksums
1163eeb8c568e1f7a705562bb6eabf48552c6760e70aee78852813d1d828a139
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.13 Linux/6.17.0-1020-azure

Release files / truto_python_sdk-0.1.6-py3-none-any.whl

Download URL truto_python_sdk-0.1.6-py3-none-any.whl
Size 24.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5a2f7963a823b64861fc3c9dd06f0ff5bacfc97f3d0b117d4ab2922afee77b4
BLAKE2b-256 checksum
How to use checksums
fe269e600cb4d53b53e80a22edc2a8127a3c19226a8ffe2afb14149b0d8cca0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.13 Linux/6.17.0-1020-azure

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page