Skip to main content

Datafuse Platform Python SDK

PyPI version License

The official Datafuse Platform Python SDK provides a type-safe, developer-friendly interface to integrate and execute secure API tools flatly into your Python apps.

Compatible with Python 3.8+, featuring comprehensive IDE autocompletion, synchronous client architecture, and robust PEP-517 compliance.


Installation

Install directly from your local project repository during development:

pip install -e sdks/python

Or from a private package repository:

pip install datafuse

Getting Started

Initialize the unified client using your platform API Key. The client handles authorization, user-agent injection, and exposes sub-client APIs on a flat model.

from datafuse import Datafuse

sdk = Datafuse(
    api_key="df_live_your_api_key_here"
)

Overriding Base URLs (Enterprise Private VPC Override)

If you are developing locally or executing within private enterprise clouds/VPC environments, you can override the target address:

sdk = Datafuse(
    api_key="df_local_secret",
    base_url="https://datafuse.your-enterprise-vpc.internal/api"
)

Code Examples

1. Browse providers, tools and triggers (public)

These endpoints require no API key.

from datafuse import Datafuse

sdk = Datafuse()

# List every provider (paginated: .items / .total / .page / .page_size)
page = sdk.providers.list_providers_api_v1_providers_get()
for p in page.items:
    print(f"{p.key:20s} {p.title} ({p.tools_count} tools, {p.triggers_count} triggers)")

# Inspect a provider's tools and triggers (each is a list of dicts)
tools = sdk.providers.get_provider_tools_api_v1_providers_key_tools_get("slack")
triggers = sdk.providers.get_provider_triggers_api_v1_providers_key_triggers_get("slack")
print(f"slack: {len(tools)} tools, {len(triggers)} triggers")
for tr in triggers:
    print(f"  {tr['slug']:35s} {tr['name']}")

2. Running Remote Tool Execution

Invoke a tool through one of your integrations.

from datafuse import Datafuse
from datafuse.generated import IntegrationInvokeRequest

sdk = Datafuse(api_key="your_api_key")

try:
    req = IntegrationInvokeRequest(
        tool_key="slack_send_message",
        arguments={
            "channel": "#alerts-production",
            "text": "🚨 Critical Alert: System health checks completed successfully."
        }
    )
    result = sdk.integrations.invoke_tool_api_v1_integrations_id_invoke_post(
        id="3c8d9e2b-23f4-4b5c-897d-1234567890ab",
        integration_invoke_request=req,
    )
    print(f"Action Output Payload: {result}")

except Exception as e:
    print(f"Execution Failed: {e}")

3. Compliance Audit Logs

from datafuse import Datafuse
from datafuse.generated import AuditLogCreate

sdk = Datafuse(api_key="your_api_key")

sdk.compliance_audit_logs.create_audit_log_api_v1_audit_logs_post(
    audit_log_create=AuditLogCreate(
        action="toolkit.install",
        resource_type="toolkit",
        resource_id="slack",
        metadata_json={"author": "admin", "ip": "127.0.0.1"},
    )
)
logs = sdk.compliance_audit_logs.list_audit_logs_api_v1_audit_logs_get()
for log in logs:
    print(f"- {log}")

Client Organization

The high-level Datafuse class exposes a flat namespace of sub-clients, discovered dynamically from the generated package so it always matches the current API spec. Each method maps 1:1 to a v1 endpoint:

  • .providers — list providers/categories, fetch a provider's tools and triggers, manage custom providers.
  • .integrations — create integrations and invoke/resolve/test tools.
  • .connected_accounts — connect, list and disconnect accounts.
  • .playground — chat threads and streaming.
  • .authentication — login, register, refresh, /auth/me.
  • .api_keys — create, list and delete API keys.
  • .organizations, .billing, .oauth (o_auth), .compliance_audit_logs — account, billing, OAuth and audit operations.

Method names are generated from the spec's operationId (e.g. providers.get_provider_triggers_api_v1_providers_key_triggers_get). Use your IDE's autocompletion on each sub-client to discover them.

Authentication

The key you pass is wired into both security schemes the API declares — Authorization: Bearer <key> (OAuth2) and x-api-key: <key> — so every endpoint receives the right credential automatically.


License

Proprietary © Datafuse. All rights reserved.

Metadata

Release files for datafuse-sdk 1.0.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 datafuse-sdk 1.0.0
File Size Uploaded Provenance Actions
datafuse_sdk-1.0.0.tar.gz 66.6 kB Without provenance Details for datafuse_sdk-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datafuse-sdk 1.0.0
File Interpreter ABI Platform Actions
datafuse_sdk-1.0.0-py3-none-any.whl Python 3 none any Details for datafuse_sdk-1.0.0-py3-none-any.whl

Total release size: 258.1 kB

Release files / datafuse_sdk-1.0.0.tar.gz

Download URL datafuse_sdk-1.0.0.tar.gz
Size 66.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d35a83937fb10d09edb06c831752699f179a50848e9ed2970834d1f21c327258
BLAKE2b-256 checksum
How to use checksums
eacc14bcef183df1ec777ddbba287b9b9854935ad2aebda2922e0b7cf2fa7dd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / datafuse_sdk-1.0.0-py3-none-any.whl

Download URL datafuse_sdk-1.0.0-py3-none-any.whl
Size 191.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b34d564e20ed9fd8f09cbf728d0f83ee5814dcdd920e06c4b960207ed1867bef
BLAKE2b-256 checksum
How to use checksums
9cb013014dc89c92ad7198143b86c8b3f0c11fd0d391ac0545ce3adde8d41e8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for datafuse-sdk 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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