Extractor API Reference
This function serves as the main entry point for extracting element data from Relatics and transforming it into a set of normalized pandas DataFrames. It orchestrates the full extraction workflow across a specified list of elements within a workspace, including data retrieval, schema validation, table normalization, and application of transformations of the data into relational tables.
The function supports both sequential and parallel execution, making it suitable for small ad hoc extracts as well as larger data pipelines. Optionally, selected to-one relations can be inlined into the resulting element tables, simplifying downstream analysis and reporting. The output is a dictionary of transformed DataFrames that can be used directly for further processing, analytics, or data integration tasks.
Overview
relatics_toolkit.extract_element_tables(client, workspace_id, element_ids, operation, parallel=False, max_workers=None, inline_relations=None)
Extracts and transforms Relatics elements into normalized tables.
For the specified workspace and element IDs, retrieves the corresponding Relatics XML payloads, validates the extracted schema, normalizes the resulting tables, and applies business transformations.
Processing can be executed sequentially or in parallel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
RelaticsClient
|
Configured Relatics API client. |
required |
workspace_id
|
str
|
Workspace ID containing the elements that should be extracted. |
required |
element_ids
|
list[str]
|
Element IDs that should be extracted from the workspace. |
required |
operation
|
str
|
Relatics operation name used to retrieve the element data. |
required |
parallel
|
bool
|
Whether element extraction should be executed in parallel. |
False
|
max_workers
|
int | None
|
Maximum number of worker threads used when parallel is True. If None, the ThreadPoolExecutor default is used. |
None
|
inline_relations
|
list[str] | None
|
Relation names of relations to R2 elements whose values should be materialized directly in the resulting element tables (must be to-one relations). |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, DataFrame]
|
Dictionary mapping table names to transformed pandas DataFrames. |
Raises:
| Type | Description |
|---|---|
Exception
|
Any exception raised during retrieval, validation, normalization, or transformation of element data. |
Source code in src/relatics_toolkit/extraction_service.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |