Installation & Authentication
This guide covers installing the TitanRDM Python SDK and authenticating with your TitanRDM instance.
Installation
From PyPI
pip install titan-rdm-sdk
In Databricks
%pip install titan-rdm-sdk
From a Wheel File
%pip install /dbfs/path/to/titan_rdm_sdk-0.1.7-py3-none-any.whl
From Source
pip install git+https://github.com/dimodelo/titan-rdm-sdk-python.git
Prerequisites
Before using the SDK, you need:
- TitanRDM instance URL — Your tenant URL (e.g.
https://your-tenant.app.titanrdm.com) - OAuth Client Credentials — A
client_idandclient_secretprovisioned in TitanRDM
Contact your TitanRDM administrator to obtain API credentials.
Authentication
The SDK uses OAuth 2.0 Client Credentials flow. Authentication happens automatically when you create a TitanRDMClient instance.
from titan_rdm_sdk import TitanRDMClient
client = TitanRDMClient(
url="https://your-tenant.app.titanrdm.com",
client_id="your_client_id",
client_secret="your_client_secret",
)
The client will: - Authenticate immediately on creation - Automatically refresh the token when it nears expiry (within 5 minutes) - Handle token refresh in a thread-safe manner
Token Expiry
You can inspect the token expiration:
print(f"Token expires at: {client.token_expires_at}")
Storing Credentials Securely
Environment Variables
import os
from titan_rdm_sdk import TitanRDMClient
client = TitanRDMClient(
url=os.environ["TITAN_RDM_URL"],
client_id=os.environ["TITAN_RDM_CLIENT_ID"],
client_secret=os.environ["TITAN_RDM_CLIENT_SECRET"],
)
Databricks Secret Scopes
TITAN_URL = dbutils.secrets.get(scope="titan-rdm", key="url")
TITAN_CLIENT_ID = dbutils.secrets.get(scope="titan-rdm", key="client_id")
TITAN_CLIENT_SECRET = dbutils.secrets.get(scope="titan-rdm", key="client_secret")
client = TitanRDMClient(
url=TITAN_URL,
client_id=TITAN_CLIENT_ID,
client_secret=TITAN_CLIENT_SECRET,
)
To set up a Databricks secret scope:
databricks secrets create-scope --scope titan-rdm
databricks secrets put --scope titan-rdm --key url
databricks secrets put --scope titan-rdm --key client_id
databricks secrets put --scope titan-rdm --key client_secret
Snowflake Secrets
Use Snowflake's built-in secrets management to store credentials and retrieve them in your Snowpark session.
Google Cloud Secret Manager
For BigQuery environments, use Google Cloud Secret Manager or environment variables configured in your compute environment.
Verifying Your Connection
After creating the client, verify access by listing branches:
branches = client.get_branches()
print(f"Connected! Found {len(branches)} branch(es)")
for b in branches:
print(f" [{b.id}] {b.name} (type={b.branch_type}, status={b.status})")
Next Steps
- Uploading Data — Send data to TitanRDM
- Downloading Data — Export data from TitanRDM
- SDK Client Methods — Browse metadata (branches, domains, tables)