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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datafuse_sdk-1.0.0.tar.gz (66.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datafuse_sdk-1.0.0-py3-none-any.whl (191.5 kB view details)

Uploaded Python 3

File details

Details for the file datafuse_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: datafuse_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 66.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for datafuse_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d35a83937fb10d09edb06c831752699f179a50848e9ed2970834d1f21c327258
MD5 7caa216493bc8a0560833bdff0261de7
BLAKE2b-256 eacc14bcef183df1ec777ddbba287b9b9854935ad2aebda2922e0b7cf2fa7dd0

See more details on using hashes here.

File details

Details for the file datafuse_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: datafuse_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 191.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for datafuse_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b34d564e20ed9fd8f09cbf728d0f83ee5814dcdd920e06c4b960207ed1867bef
MD5 5097d07d81e61211d0c0b699c806a6d7
BLAKE2b-256 9cb013014dc89c92ad7198143b86c8b3f0c11fd0d391ac0545ce3adde8d41e8a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 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