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.12+

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

Full reference

Every resource and method, with examples, is documented at truto.one/docs/sdks/python: the Unified, Proxy and Custom APIs, MCP, integrated accounts, tenants, integrations, unified models and mappings, sync jobs, webhooks, workflows, datastores, analytics, and more.

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

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.2.0
File Size Uploaded Provenance
truto_python_sdk-0.2.0.tar.gz 13.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 43.5 kB

Release files / truto_python_sdk-0.2.0.tar.gz

Download URL truto_python_sdk-0.2.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
632a0801afb0d340322c9c9409af4e48980557f16f9a0b58facc241b928ffd5a
BLAKE2b-256 checksum
How to use checksums
02f2fb3f09b65488b958a58f1d8e22782ba266bb12d95261eb8def157910dcdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.3 Linux/7.0.0-1017-azure

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

Download URL truto_python_sdk-0.2.0-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bdefcb13c9f991d92e6ca6073a6126f3f0f58a3bf1b3d19abb06425fdd89618
BLAKE2b-256 checksum
How to use checksums
05b22015c79594abd026fab07d70f1c4e63e50d91612ebf5b7d77ca66686db33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.3 Linux/7.0.0-1017-azure

Security for truto-python-sdk 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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