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

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.0.tar.gz (149.7 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.0-py3-none-any.whl (122.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rdp_sdk_python-2026.26.0.tar.gz
  • Upload date:
  • Size: 149.7 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.0.tar.gz
Algorithm Hash digest
SHA256 0a47728b6c4030c26515a899c23824f29d23d5c074e3ed5d02efab41745b8903
MD5 201966ca2b1aba1308ffc995d19a5789
BLAKE2b-256 da876b1596f30a2dbf7ba44cd3d74eb303b92b57d04b7619004d57e7c65abc3c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rdp_sdk_python-2026.26.0-py3-none-any.whl
  • Upload date:
  • Size: 122.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 238c1ef803f0a5d97f16bd6cd150dee71bf91c994fe5dbd796db98bb684db8b2
MD5 f0a5d7e6c65dcb6d6823246c7bb55dd8
BLAKE2b-256 c41786e1da665c350a6c1d2c49e52699a9fd279bace60627a5393722bba987a9

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