Skip to main content

Python SDK for client applications interacting with RDP.

Project description

RDP SDK for Python

The RDP SDK for Python is part of the unified SDK family for client applications interacting with Raft Data Platform (RDP). It provides async Python APIs, configuration, authentication, TLS, logging, and timeout helpers for the RDP API surface.

For platform concepts, API guides, and integration details, see https://developer.teamraft.com.

Installation

Python 3.12 or newer is required. Install with the Python interpreter you plan to use:

python3 -m pip install rdp-sdk-python

If your system has multiple Python versions, use the Python 3.12+ binary directly, for example python3.12 -m pip install rdp-sdk-python.

Quick Start

export RDP_SERVER_URL=https://rdp.example.com
export RDP_API_KEY=your-api-key
import asyncio

import rdp_sdk
import structlog
from raft.wdm.v1.service import object_service_pb2


async def main() -> None:
    # Load RDP_SERVER_URL and authentication from the environment.
    cfg = rdp_sdk.load_config(logger=structlog.get_logger())

    # Create a client from the loaded config.
    async with rdp_sdk.Client.from_config(cfg, timeout=10.0) as client:
        # Request the first 10 WDM objects.
        response = await client.object_service.search_objects(
            object_service_pb2.SearchObjectsRequest(page_size=10),
        )

        if not response.objects:
            print("No WDM objects found.")
            return

        for obj in response.objects:
            print(f"{obj.id}\t{obj.name}")


asyncio.run(main())

For more examples, see examples.

Configuration

load_config() reads connection settings from environment variables and returns a validated RdpConfig. Pass a structlog-compatible logger for validation warnings, and pass env_path to load a dotenv file before reading the process environment.

Variable Required Description
RDP_SERVER_URL No Base RDP endpoint. Defaults to https://rdp.local; use scheme and host only.
RDP_SERVER_PORT No Optional port override for the endpoint.
TLS_SKIP_VERIFY No Set to true only for development or test endpoints with self-signed certificates.
RDP_PROTOCOL No Optional ConnectRPC protocol override: connect, grpc, grpc_web, or grpc-web.

Authentication

API key authentication is the preferred method for client applications. Use OAuth2 client credentials only when your deployment requires token exchange.

Method Variables Request behavior
API key RDP_API_KEY Sends the value on each request as an API key header.
OAuth2 client credentials RDP_CLIENT_ID, RDP_CLIENT_SECRET Fetches a token from {RDP_SERVER_URL}/api/v1/auth/token and sends it as a bearer token.

Providing both auth methods is an error. If neither method is configured, requests are sent without auth and the SDK logs a warning.

Functional Configuration

Pass keyword arguments to Client(...), or use Client.from_config(cfg, **overrides) to layer programmatic values on top of a loaded RdpConfig. Overrides win over values loaded from the environment.

For direct construction:

logger = structlog.get_logger()

async with rdp_sdk.Client(
    "https://rdp.example.com",
    api_key="your-api-key",
    timeout=10.0,
    logger=logger,
) as client:
    # call generated service clients
    ...

For environment-first configuration with programmatic overrides:

cfg = rdp_sdk.load_config(env_path=".env.local", logger=logger)

async with rdp_sdk.Client.from_config(
    cfg,
    timeout=10.0,
) as client:
    # call generated service clients
    ...

Use client_id and client_secret instead of api_key only when your deployment requires OAuth2 client credentials. Use tls_skip_verify=True only for development or test endpoints with self-signed certificates. Pass protocol=... only when you need to force a specific ConnectRPC protocol.

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

rdp_sdk_python-2026.26.1.tar.gz (149.8 kB view details)

Uploaded Source

Built Distribution

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

rdp_sdk_python-2026.26.1-py3-none-any.whl (122.7 kB view details)

Uploaded Python 3

File details

Details for the file rdp_sdk_python-2026.26.1.tar.gz.

File metadata

  • Download URL: rdp_sdk_python-2026.26.1.tar.gz
  • Upload date:
  • Size: 149.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for rdp_sdk_python-2026.26.1.tar.gz
Algorithm Hash digest
SHA256 7f8004a2acab717b2eba271962b5ce75aaeb3e7e362ec5c5230853446ac48440
MD5 779bf264c9b48593f8dfb764010f85f3
BLAKE2b-256 b04634e8455247f2ed302f7c2863df59e31bf9f224acae845c4abcd76b1077b5

See more details on using hashes here.

File details

Details for the file rdp_sdk_python-2026.26.1-py3-none-any.whl.

File metadata

  • Download URL: rdp_sdk_python-2026.26.1-py3-none-any.whl
  • Upload date:
  • Size: 122.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for rdp_sdk_python-2026.26.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c11d2bda75943aeae9359951665ff1a094945d95bb06154e381f502c901516a
MD5 0c39df8688dfea2d227b0e3c9d794039
BLAKE2b-256 845f0dd9434e02e9721c143b93c66d3be1ce2908f623fd47f8c77fc43de71459

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page