SDK Client Methods

Complete reference for all TitanRDMClient methods. These methods allow you to browse TitanRDM metadata — branches, domains, deployed table definitions, and import mappings — without hard-coding IDs.


Branches

Branches in TitanRDM represent isolated environments for managing data (e.g. prod, dev, feature branches).

List All Branches

from titan_rdm_sdk import TitanRDMClient

client = TitanRDMClient(url=URL, client_id=ID, client_secret=SECRET)

branches = client.get_branches()
print(f"Found {len(branches)} branch(es)")
for b in branches:
    print(f"  [{b.id}] {b.name} (type={b.branch_type}, status={b.status})")

Returns: list[Branch]

Get Branch by ID

branch = client.get_branch(branch_id=5)
print(f"Branch: {branch.name}, status={branch.status}")

Parameters:

ParameterTypeRequiredDescription
branch_idintYesThe branch ID

Returns: Branch

Get Branch by Name

branch = client.get_branch_by_name("prod")
print(f"Branch: id={branch.id}, name={branch.name}")

For dev (private) branches, specify the owner_id to disambiguate:

branch = client.get_branch_by_name("dev", owner_id=1)

Parameters:

ParameterTypeRequiredDescription
namestrYesExact branch name
owner_idintNoOwner user ID (for private branches)

Returns: Branch

Branch Object Properties

PropertyTypeDescription
idintBranch ID
namestrBranch name
descriptionstrBranch description
branch_typestr'shared' or 'private'
statusstr'open' or 'closed'
database_suffixstrDatabase suffix for this branch
is_default_dev_branchboolWhether this is the default dev branch
is_integration_branchboolWhether this is an integration branch
parent_branch_idintParent branch ID (if any)
parent_branch_namestrParent branch name (if any)
owner_idintOwner user ID (if private)
owner_emailstrOwner email (if private)
created_atstrISO 8601 creation timestamp
updated_atstrISO 8601 last-updated timestamp

Domains

Domains are logical groupings of tables in TitanRDM (e.g. "Customer Data", "Clinics").

List All Domains

domains = client.get_domains()
print(f"Found {len(domains)} domain(s)")
for d in domains:
    print(f"  [{d.id}] {d.name} (abbrev={d.abbreviation})")

Returns: list[Domain]

Get Domain by ID

domain = client.get_domain(domain_id=1)
print(f"Domain: {domain.name}")

Parameters:

ParameterTypeRequiredDescription
domain_idintYesThe domain ID

Returns: Domain

Get Domain by Name

domain = client.get_domain_by_name("Customer Data")
print(f"Domain: id={domain.id}, abbreviation={domain.abbreviation}")

Parameters:

ParameterTypeRequiredDescription
namestrYesExact domain name

Returns: Domain

Domain Object Properties

PropertyTypeDescription
idintDomain ID
namestrDomain name
abbreviationstrShort abbreviation (used in table naming conventions)
descriptionstrDomain description
created_atstrISO 8601 creation timestamp
updated_atstrISO 8601 last-updated timestamp

Deployed Table Definitions

Deployed table definitions represent tables that have been deployed to a branch and are available for data operations.

List Deployed Tables (by Branch + Domain)

tables = client.get_deployed_table_definitions(
    branch_id=5,
    domain_id=1,
)
print(f"Found {len(tables)} deployed table(s)")
for t in tables:
    print(f"  [{t.id}] {t.name} → {t.database_table_name} ({len(t.column_definitions)} columns)")

Parameters:

ParameterTypeRequiredDescription
branch_idintYesThe branch ID
domain_idintNoFilter by domain ID

Returns: list[DeployedTableDefinition]

Get Deployed Table by Key

table = client.get_deployed_table_definition(
    key="uuid-key-here",
    branch_id=5,
)
print(f"Table: {table.name} → {table.database_table_name}")
print(f"Domain: {table.domain_name}")
for col in table.column_definitions:
    pk = " [PK]" if col.is_primary_key else ""
    req = " NOT NULL" if col.is_required else ""
    print(f"  {col.name}: {col.data_type}{pk}{req}")

Parameters:

ParameterTypeRequiredDescription
keystrYesTable definition UUID key
branch_idintYesThe branch ID

Returns: DeployedTableDefinition

DeployedTableDefinition Properties

PropertyTypeDescription
idintDeployed table definition ID
keystrUUID key
namestrTable name (display name in TitanRDM)
database_table_namestrPhysical table name (e.g. t_cust_customers)
domain_idintDomain ID
domain_namestrDomain name
domain_abbreviationstrDomain abbreviation
branch_idintBranch ID
branch_namestrBranch name
column_definitionslist[DeployedColumnDefinition]Column definitions
created_atstrISO 8601 creation timestamp
updated_atstrISO 8601 last-updated timestamp

DeployedColumnDefinition Properties

PropertyTypeDescription
idintColumn ID
keystrColumn UUID key
namestrColumn name
data_typestrData type (e.g. 'integer', 'varchar')
lengthintLength constraint (for varchar)
is_primary_keyboolPart of the primary key
is_requiredboolNOT NULL constraint
display_orderintDisplay ordering
is_deletedboolSoft-deleted flag
descriptionstrColumn description

Import Mappings

Import mappings define how source data columns map to target table columns during uploads.

Get Default Import Mapping

import_mapping = client.get_default_import_mapping(table_definition_id=42)
print(f"Mapping: {import_mapping.name} (key={import_mapping.key})")

Parameters:

ParameterTypeRequiredDescription
table_definition_idintYesThe table definition ID

Returns: ImportMapping

Get Import Mapping by Key

import_mapping = client.get_import_mapping_by_key(
    table_definition_id=42,
    key="uuid-mapping-key",
)

Parameters:

ParameterTypeRequiredDescription
table_definition_idintYesThe table definition ID
keystrYesImport mapping UUID key

Returns: ImportMapping

ImportMapping Properties

PropertyTypeDescription
idintImport mapping ID
keystrUUID key
table_definition_idintParent table definition ID
table_definition_namestrParent table name
namestrMapping name
is_defaultboolWhether this is the default mapping
branch_idintAssociated branch ID
branch_namestrAssociated branch name
mapping_configdictColumn mapping configuration
created_atstrISO 8601 creation timestamp
updated_atstrISO 8601 last-updated timestamp

Complete Discovery Example

A typical workflow to discover the metadata you need:

from titan_rdm_sdk import TitanRDMClient

client = TitanRDMClient(url=URL, client_id=ID, client_secret=SECRET)

# 1. Find your branch
branch = client.get_branch_by_name("prod")

# 2. List domains
domains = client.get_domains()

# 3. Get deployed tables for each domain
for domain in domains:
    tables = client.get_deployed_table_definitions(
        branch_id=branch.id,
        domain_id=domain.id,
    )
    print(f"[{domain.abbreviation}] {domain.name}: {len(tables)} table(s)")
    for t in tables:
        print(f"  → {t.database_table_name} (key={t.key})")

Next Steps